现在位置: 首页 > Python 基础教程 > 正文

Python 练习实例32

Python 100例 Python 100例

题目:按相反的顺序输出列表的值。

程序分析:无。

程序源代码:

实例

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

以上实例输出结果为:

three
two
one

Python 100例 Python 100例