Latest web development tutorials

Python incluye ejercicios 32

Python 100 Li Python 100 Li

Título: revertir valor de salida orden de la lista.

Análisis del programa: Ninguno.

Código fuente:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

a = ['one', 'two', 'three']
for i in a[::-1]:
	print i

La salida del ejemplo anterior es:

three
two
one

Python 100 Li Python 100 Li