Ok so I am making a python random number generator with the parameters defined by the user. I am writing this on python 3.4. this is the code:
import random
import time
name = input("whats your name? ")
numOfNums = input("ok " + name + " how many numbers do you want to randomize? ")
def randomGenerator():
randomFinal = random.randint(1, numOfNums)
print (randomFinal)
rerun = input("Do you want to pick another random number? ")
if rerun == "yes":
time.sleep(0.05)
randomGenerator()
else:
print("you may now close this windows")
randomGenerator()
I am having an issue with the line:
randomFinal = random.randint(1, numOfNums)
I cannot use the variable 'numOfNums' as a parameter. Do you have any ideas?