(5)条件语句

一、简单逻辑

if condition1:
    statement1
else:
    statement2

二、多条件逻辑

if condition1:
    statement1
elif condition2:
    statement2
...
elif conditionN:
    statementN
else:
    statement

三、三元运算 

[on_true] if [expression] else [on_false]

猜你喜欢

转载自blog.csdn.net/panyueke/article/details/86357650