Python generate a number between 1 and 20, and the user has six times to guess it.
Iuput:
Python generate random number: radint(a,b)(remember to import radiant)
radint(a,b)
User enter a number 1-20: input()(pay attention to the type of the input)
input()
Output:
if right--Congratuations!
if wrong--It's close, the right number is between x(input)-1/20,don't worry you still have ? times--raw_input()
raw_input()
if right--...
if wrong--...--Oops, no more chance, try one more time!
Progress:
...
Github Code Linkarrow-up-right
Last updated 7 years ago