if-else 语句:
if<condition1>:
<clause1>
elif <condition2>:
<clause2>
else:
<clause3>
for 循环
python中的for循环,通过,循环遍历某一序列对象(元组,列表等)来构建循环
for <循环变量> in <遍历对象>:
<语句1>
else:
语句2
只有循环正常推出,else语句才会执行
if-else 语句:
if<condition1>:
<clause1>
elif <condition2>:
<clause2>
else:
<clause3>
for 循环
python中的for循环,通过,循环遍历某一序列对象(元组,列表等)来构建循环
for <循环变量> in <遍历对象>:
<语句1>
else:
语句2
只有循环正常推出,else语句才会执行