1 count = 0 2 age_to_guess = 23 3 4 while count<3: 5 age_guessed = int(input("age:")) 6 if age_guessed == age_to_guess: 7 print("congratulations") 8 break 9 elif age_guessed > age_to_guess:10 print("Too big")11 else:12 print("Too small")13 count = count + 114 if count == 3:15 confirm_input = input("Do you want to play more?")16 if confirm_input != "n":17 count = 0
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did84907