📜  python 向后遍历列表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:02.457000             🧑  作者: 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)