005_while

#!/usr/bin/env python
# Author:liujun

age=56
count=0
while count < 3:
guessage = int(input("guess age:")) #Data type conversion is needed.
if guessage == age:
print("yes you got it")
break;
elif guessage > age:
print("bigger")
else:
print("smaller")
count += 1
else:
print("you have tried too many times...fuck off")

# while ... else is special grammar in python


posted on 2018-09-03 14:34  langjitianyadaolao  阅读(103)  评论(0编辑  收藏  举报

导航