I guess the age of games, prizes, three chances

18 is = Age
COUNT = 0
prize_dict = {0: 'dolls', 1:' Transformers', 2: 'Altman' 3: ' '}
The while COUNT <3:
inp_age the INPUT = (' Please enter your age >>> ')
IF not inp_age.isdigit ():
Print (' sucker, your age mistyped ')
the Continue
inp_age_int = int (inp_age)
Age inp_age_int == IF:
Print ( 'guessed')
Print (prize_dict)
for i in the Range (2):
prize_choice the iNPUT = ( 'Please enter the prize you want, if you do not want to, enter "n" quit! !! ')
! = IF prize_choice' n-':
Print (F' Congratulations on your prize: {prize_dict [int (prize_choice)]} ')
the else:
BREAK
BREAK
elif inp_age_int <Age:
Print (' small guess')
the else :
Print ( 'big guess')
COUNT = + 1
IF COUNT = 3!:
continue
again_choice = input ( 'whether to continue the game, continue to enter "Y", otherwise any key to exit.')
IF again_choice == 'the Y-':
COUNT = 0

Guess you like

Origin www.cnblogs.com/jinhongquan/p/11290939.html