Python3条件控制

Python3条件控制

if语句

if condition_1:
    statement_block_1
elif condition_2:
    statement_block_2
else:
    statement_block_3

if嵌套

if 表达式1:
    语句
    if表达式2:
        语句
    elif 表达式3:
        语句
    else:
        语句
elif 表达式4:
    语句
else:
    语句

 

posted @ 2019-10-18 10:30  Chensh丶  阅读(165)  评论(0)    收藏  举报