while循环

2018-05-21  本文已影响5人  一盏省油的小灯
# -*- coding: utf-8 -*-
# @Author: yt
# @Date:   2018-05-21 09:10:23
# @Last Modified by:   yt
# @Last Modified time: 2018-05-21 09:14:11

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
    
运行结果如下: 图1
上一篇 下一篇

猜你喜欢

热点阅读