lst = [1, 2, 3, 4, 5] reversed_lst = lst[::-1]
for item in reversed_lst: print(item)
这将按照逆序打印列表中的元素。
上一篇:不使用函数创建多个case的视图
下一篇:不使用函数的返回值调用会产生什么效果?