Hi this might be a obvious answer but I cant get the random number to display when i put my name as ranNum , This is kind of a dev key to see if the random number works, I know I could just put print (ranNum) but I would like it in the python program. Thanks.
I got it working I am really stupid
Just add a variable called devkey = 'ranNum'
then:
if myName == devkey:
print (ranNum)
else:
print ()
import random print("Hello \nPlease enter your name") myName = input() ranNum = random.randint(1, 100) if myName == ranNum: print (ranNum) else: print ()
I got it working I am really stupid
Just add a variable called devkey = 'ranNum'
then:
if myName == devkey:
print (ranNum)
else:
print ()