Python 练习范例 32
按相反的顺序输出列表的值
#!/usr/bin/python # -*- coding: UTF-8 -*- a = ['one', 'two', 'three'] for i in a[::-1]: print i
以上 Python 代码输出结果如下
three two one
按相反的顺序输出列表的值
#!/usr/bin/python # -*- coding: UTF-8 -*- a = ['one', 'two', 'three'] for i in a[::-1]: print i
以上 Python 代码输出结果如下
three two one
♥ 简单教程,简单编程 - IT 入门首选站
Copyright © 2013-2022 简单教程 twle.cn All Rights Reserved.