day05
if 语句
单分支判断if
if 条件:
语句
双分支判断 if else
if 条件:
语句
else:
语句
多分支判断 if elif ... else
if 条件:
语句
elif 条件:
语句
elif 条件:
语句
...
...
else 条件: # 也可以不加else
语句
while语句
break 终止循环
continue 不执行后面的代码,直接进行下一次循环
while + else(了解)
当while循环没有被break掉的时候,会执行中的else代码
while 条件:
语句
else:
语句
for
break 终止循环
continue 不执行后面的代码,直接进行下一次循环
for + else(了解)
当for循环没有被break掉的时候,会执行else中的代码