python,for,while循环控制

1、for循环

for循环

for i in range(0,5):
  for j in range(0,5):
  print('#'*5)

2、while 循环

import random #get number?#导入生成随机数模块
a = random.randint(0,100) #生成随机数
b=-1
print(a)
while a!=b:#开始循环
  b=int(input("please input number"))
  if a>b :
    print ("is too small")
  elif a<b :
    print("is too big")

print("you are ringt")

  

posted on 2016-11-28 15:58  别说话,吻我!  阅读(134)  评论(0编辑  收藏  举报