#I'm a beginner help me to fix out.. Write a program where the computer randomly generates a number between 0 and 20. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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")

14th Mar 2020, 5:04 AM
SelvaKumar
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/
14th Mar 2020, 7:04 AM
Daljeet Singh
Daljeet Singh - avatar
+ 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!
14th Mar 2020, 5:36 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
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")
14th Mar 2020, 5:47 AM
SelvaKumar