📜  python iterate list reverse - Python代码示例

📅  最后修改于: 2022-03-11 14:45:24.976000             🧑  作者: Mango

代码示例2
>>> a = ["foo", "bar", "baz"]
>>> for i in reversed(a):
...     print(i)
... 

or

>>> for i, e in reversed(list(enumerate(a))):
...     print(i, e)