python语法

一、条件循环语句

python 中if else 有两种形式

第一种:

if xxxx : else: xxxx

第二种:

if xxxx:
xxxxx
elif xxxx:
xxxxx
elif xxxx:
xxx
else:
xxxx
相当于其他语言里的 switch xxx case xxxx
 
二、循环遍历:
1) for xxxx in xxxx
 遍历一个序列
2)while
continue:只用于循环中,不执行下面的语句(一次循环)
break:跳出整个循环

 

posted @ 2018-09-06 14:28  大阿曼  阅读(74)  评论(0)    收藏  举报