+ 1
Why is it not working?
The user has to guess a number between 1-100. The number shouldnt be above 100 or below 1 or else he will be alerted âu can only choose between 1-100â. If its close (5 numbers or less) to the random number he will be alerted âwrong but close the number is higher âorâ lower. Otherwise he will be alerted âwrong the number is higher âorâ lowerâ. And right guess will print âCorrectâ This is my code: https://code.sololearn.com/cxRh9a1onYJu/?ref=app
3 Answers
+ 1
Lenoname Start with this condition :
if guess > 100 or guess < 1 :
print('Wrong, You can only guess numbers between 1-100')
elif...
.
.
.
0
Take
x = random.randint(1,100) #
And anything else wrong you getting ?
0
Jayakrishnađźđł anything under 1 gets printed as just âwrong the number is higherâ and anything above 100 âwrong number is lowerâ, i want it to say âwrong u can only pick numbers between 1-100â