I am a beginner at python and currently working on a project. When I try to run this code, it keeps telling me that random_Number and users_Guess is not defined.
#Impots the random module
import random
#Calls all functions
def main():
generateNumber()
inputUsersGuess()
displayAnswer()
#Generates the random number
def generateNumber():
random_Number=random.randint(1,100)
return random_Number
#Takes the users guess
def inputUsersGuess():
users_Guess=int(input('I am thinking of a number. What is the number? '))
return users_Guess
#Compares the users guess with the number generated
def displayAnswer():
if random_Number==users_Guess:
print('You guessed correctly!')
else:
print('Sorry, your guess is incorrect. I was thinking of',random_Number)
#Calls the main function
main()