列表逆序遍历
reversed() 函数
a = ["我", "用", "Python"]
a_r = list(reversed(a))
## ["Python", "用", "我"]
for i in a_r:
print(i)
## Python
## 用
## 我
字典逆序遍历
zip()
for key, val in zip(list(reversed(list(mydict.keys()))), list(reversed(list(mydict.values())))):
print(key, ":", val)
## ...
## key2:value2
## key1:value1