I am writing a simple code to find even or odd numbers, the code was working just fine but maybe I did something wrong and it started giving me this error.
File "d:\Python\EvenOddFinder.py", line 12, in restart restartornot = input() File "", line 1, in NameError: name 'y' is not defined
#Even or Odd Number Finder.
def start():
userInput = input("Please input your number:")
userInput = int(userInput)
if userInput %2 == 0:
print("The number " + str(userInput) + " is Even.")
else:
print("The number " + str(userInput) + " is Odd.")
def restart():
print("Do you want to restart?")
print("Y/N")
restartornot = input()
if restartornot == "Y":
start()
elif restartornot == "y":
start()
elif restartornot == "N":
exit()
elif restartornot == "n":
exit()
else:
print("Invalid Input.")
restart()
restart()
start()
Please help me I am quite new to Python.