age = 30 c = 0 #定义记数器 for i in range(10): if c < 3: guess = int(input("Plseae guess my age:")) if guess == age: print("Yes,your are right") break elif guess < age: print("It is too little") else: print("Tt is too big") else: continue_confirm = input("continue press ‘yes‘,exit press ‘no‘:") if continue_confirm == ‘yes‘: c = 0 elif continue_confirm == ‘no‘: print("see you") break else: print("Wrong words") c += 1
时间: 2024-12-14 13:38:47