程序源代码:
实例
#!/usr/bin/python # -*- coding: UTF-8 -*- a = ['one', 'two', 'three'] for i in a[::-1]: print (i)
以上实例输出结果为:
three
two
one
Python 练习实例-题目:按相反的顺序输出列表的值
阅读 36
2023-10-19
程序源代码:
#!/usr/bin/python # -*- coding: UTF-8 -*- a = ['one', 'two', 'three'] for i in a[::-1]: print (i)
以上实例输出结果为:
three
two
one
相关推荐
精彩评论(0)