ex33

 1 def while_1(i, numbers, bianliang):
 2     while i < bianliang:
 3         print(f"At the top i is {i}")
 4         numbers.append(i)
 5         
 6         i = i + 1
 7         print("Numbers now:",numbers)
 8         print(f"At the bottom i is {i}")
 9 
10 while_1(0, [], int(input(">>>")))
11     
1 def while_1(i, numbers, bianliang,canshu):
2     while i < bianliang:
3         print(f"At the top i is {i}")
4         numbers.append(i)
5         i = i + canshu        
6         print("Numbers now:",numbers)
7         print(f"At the bottom i is {i}")  
8 
9 while_1(0, [], int(input(">>>")),2)
i = 0
numbers = []

for i in range(0,6):
    print(f"At the top is {i}")
    numbers.append(i)
    print("Numbers now:", numbers)
    print(f"At bottom i is {i}")

 

posted @ 2018-12-25 23:52  yuriya  阅读(337)  评论(0)    收藏  举报