首页 > 其他 > 详细

Exercise 33: While Loops

时间:2014-10-25 11:45:44      阅读:163      评论:0      收藏:0      [点我收藏+]

while用起来不如for安全。

i = 0
numbers = []
while i < 6:
  print "At the top i is %d" % i
  numbers.append(i)
  i = i + 1
  print "Numbers now: ", numbers print "At the bottom i is %d" % i
  print "The numbers: "
for num in numbers:
  print num

 

Exercise 33: While Loops

原文:http://www.cnblogs.com/hluo/p/4049850.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!