📜  python枚举for循环 - Python代码示例

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

代码示例6
presidents = ["Washington", "Adams", "Jefferson", "Madison", "Monroe", "Adams", "Jackson"]
for num, name in enumerate(presidents, start=1):
    print("President {}: {}".format(num, name))