python中的条件判断和循环

一、if ..else:

if 条件语句:

  xxx

else:

  xxx

#  条件成立则执行

二、while

while  条件语句

  xxx

#条件为真则执行

三、for

for  xx in xxx:

  xxx

break    退出当前循环

continue  结束当前循环进入下一轮循环

原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/7732628.html