📜  python función enumerate - Python 代码示例

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

代码示例1
>>> frutas = ["manzanas", "peras", "naranjas"]
>>> for i, fruta in enumerate(frutas):
...     print(i, fruta)
0 manzanas
1 peras
2 naranjas