for 循环

for循环的基本用法

 

版本三

while循环,for循环后边都可以进行else判断

lucky_num = 66
input_num = -1
for i in range(3):
input_num = int(input("input the guess number"))

if (input_num > lucky_num):
print("is bigger real number")
elif(input_num < lucky_num):
print("Is smaller real number")
else:
print("bingo")
break

else:          #while循环,for循环后边都可以进行else判断
print("too many retrys")
posted @ 2018-03-15 14:58  人无远虑  阅读(137)  评论(0编辑  收藏  举报