+ 1
#I'm a beginner help me to fix out.. Write a program where the computer randomly generates a number between 0 and 20.
The user needs to guess what the number is. If the user guesses wrong tell them their guess is either too high or too low My code : My code Import random S = int(input ("Enter the number:")) res = [ random.randrange(0,20,1) ] If s in res: print ("correct") else: print ("No")
3 Answers
+ 4
SELVANITHISH SELVANITHISH you are using lowercase and Uppercase both S is not s and I isn't = i try that out :
https://www.geeksforgeeks.org/random-numbers-in-JUMP_LINK__&&__python__&&__JUMP_LINK/
+ 3
Hi! If you want, so we can help, show us your attempt first, please. We don't do your homework for you. Thanks for understanding!
0
My code
Import random
S = int(input ("Enter the number:"))
res = [ random.randrange(0,20,1) ]
If s in res:
print ("correct")
else:
print ("No")