+ 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 Respuestas
+ 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”