Python Practice Example 32

Python 100例Python 100 Examples

Title:Output the values of the list in reverse order.

Program analysis:None.

Program source code:

Example

#!/usr/bin/python # -*- coding: UTF-8 -*- a = ['one', 'two', 'three'] for i in a[::-1]: print (i)

The output of the above example is:

three
two
one

Python 100例Python 100 Examples

Other extensions