age=22 counter=0 for i in range(10): if counter<3: guess_num=int(input("请猜年龄")) if guess_num==age: print("恭喜你猜对了") break elif guess_num >age: print("太大了") else: print("太小了") else: continue_isntit=input("你猜了太多次了真笨是否继续?输入:q 继续") if continue_isntit=="q": counter=0 continue else: break counter += 1
时间: 2024-11-16 00:22:07