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: 语句
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: 语句