if语句:
if guess==number: print 'yes' elif guess>number: print 'big' else: print 'small' #python没有switch语句
while语句:
while running: print 'It is running' else: print 'The while loop is over!' #python中可在while循环里使用一个else从句
for语句:
for i in range(1,5,2) print i else: print 'The for loop is over' #如果包含else,则总在for循环结束后执行一次,除非遇到break #range第三个数将成为步长,缺省为1
break,continue用法同c语言。
来源:https://www.cnblogs.com/sunchangjun/p/3909985.html