age = 18count = 3while count > 0: guess = int(input("请输入年龄:")) if guess > age : print("猜大了,往小里猜") count -= 1 elif guess < age : print("猜小了,往大里猜") count -= 1 else: print("恭喜,猜对了") break;
2018.9.13猜年龄小游戏
原文:https://www.cnblogs.com/DariusZhou/p/9642196.html