代码改变世界

哗啦啦python之路 - Day 2 - 程序控制结构

2016-05-14 16:19  人畜无害哗啦啦  阅读(199)  评论(0编辑  收藏  举报

1. 程序流程图

 

 

2. if 结构

if score >= 90:

print 'A'

elif score >= 80:

print 'B'

elif score >= 70:

print 'C'

else:

print 'D'

 

3. while 循环结构

 

count = 0

 

while count <5:

      print 'programming is fun!'

      count += 1

 

4. break和continue的用法

5. range使用方法

 

6. 用range算常数e