📜  函数迭代期间的索引 - 无论代码示例

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

代码示例1
# This statement:
if x < 5:
    return 10
else:
    return 20

# Can be reduced to this one:
return 10 if x < 5 else 20