Exercise 1 _ guess age, win prizes

Guess Age game
1 of a given age, a user can guess three times the age of
2, age guessed, allowing users to draw twice
3, the user can exit the lottery twice bonus

20 is = Age
COUNT = 0
s_count = # define the maximum number of cycles. 3
prize_list = [ 'dolls'' Iron Man ',' Jingu Bang ',' Python interesting class']
the while COUNT <s_count:
age_inp = INPUT ( 'please enter your guess age: ')
IF not age_inp.isdigit ():
Print (' enter pure digital ')
the Continue
IF age_inp == Age:
Print (' guessed it, I congratulate you twice lucky draw ')
ANS1 = input ( "enter abandoned 'N' or 'n' lottery 0,1,2,3 select one of the digital inputs:.")
IF ANS1 == 'N' or ANS1 == 'n':
Print ( 'You abandoned, thank participation ')
BREAK
IF ANS1 in [' 0 ','. 1 ',' 2 ','. 3 ']:
prize = prize_list [int (ANS1)]
Print (F' Congratulations on your prize: {prize} ')
ANS2 = iNPUT ( "there is a chance to draw abandon enter'. N 'or' n 'lottery 0,1,2,3 select one of the digital inputs:")
IF ANS2 == 'N' or ANS2 == 'n-':
Print ( 'You abandoned, thank participation')
elif ANS2 in [ '0', '. 1', '2', '. 3']:
prize2 = prize_list [int (ANS2)]
Print (F 'Congratulations on your prize: {prize2} \ n the game is over, thanks participation')
BREAK
elif age_inp> Age:
Print ( 'guess big')
elif age_inp <Age:
Print ( 'guess small')
COUNT = + 1
IF COUNT <s_count:
Choice = the iNPUT ( "continue to play it continues to enter 'Y' or 'y', do not continue to press any key to exit:?")
IF Choice = = 'Choice Y'or ==' the y-':
Print (' one more time ')
!! elif Choice =' Choice Y'or = 'the y-':
Print ( 'Thank you for participation')
BREAK
IF COUNT == s_count:
Print ( 'three chances had run out, thank participation')
BREAK

Guess you like

Origin www.cnblogs.com/allenchen168/p/11516854.html