python學習[第二篇] 基礎二
阿新 • • 發佈:2018-07-04
if 語句 div 控制 lua iter only repeat lock ase
控制結構
if 語句
# only if block if condition: if_true_block # if_else block if condition: if_true_block else: if_false_block # if_elif_else block if condition: if_true_block elif condition: elif_true_block elif condition: elif_true_block else: all_false_block # if 嵌套 blockif outer_condition: if inner_condition: inner_condition_true_block else: inner_condition_false_block else: outer_if_false_block
while 結構
# while only while condition : while_clause # while-else clause: while condition: while_clause else: else_cluase
for 結構
# for結構 for iter_var in iterable: suite_to_repeat
python學習[第二篇] 基礎二