Here's a part of the the code I'm trying to run:
def func1():
a = True
while a == True:
try:
guess = int(input("guess it: "))
a = False
except ValueError:
print("Not a valid number.")
import random
number = random.randint(0, 50)
print("Im thinking of a number between 0 and 50,")
func1()
if guess == number:
print("Perfect, you got it from the first try!")
I don't know why I get this: NameError: name 'guess' is not defined, even though I defined it in "func1"