I am writing a program in which I have the function guessgetter defined like this:
def guessgetter():
print("What number do you choose?")
num = int(input())
if num > 100 or num < 1:
print("Please choose a number between 1 and 100")
guessgetter()
I know that this syntax is valid. However, when I refer later on in the code (yes, after running the function I created) to num, it says that I have not defined a value for it. How can I fix this?