python 入门 guess 函数,,猜年龄限制次数,使用
python 入门 guess 函数,,猜年龄限制次数,使用
猜年龄限制次数,使用while函数和count计数器。
age_of_spencer = 28count = 0while True: if count == 2: break age = int(input("age:")) if age == age_of_spencer: print("you made it") break elif age >= age_of_spencer: print("too big") else: print("too small") count = count + 1if count==2: print("you had tried too many times")
python 入门 guess 函数
评论关闭