while循环猜数字
while循环猜数字
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:young
age_of_young = 30
count = 0
while count <3:
guess_age = int(input("guess_age:"))
if guess_age < age_of_young:
print("you think smaller")
elif guess_age > age_of_young:
print("you think bigger")
else:
print("you think is very good!")
break
count+=1
if count == 3:
answer = input("Do you want to try agin?")
if answer == "y":
count = 0
else:
print("you think too mary!")