I’ve written a chunk of code in python based on functions. However, my simple program is not working and throwing an error. Being a new student to the programming world I’m unable to figure out the problem and fix it. Please, find my sample code below and fix the error for me.
n = str(input("Enter a number here: "))
if(n == '1'):
elif (n == '2'):
print('This is function one')
print('This is function two')
And the error I’m getting:
NameError: name 'one' is not defined
Here, I am trying to get input and compare it with my variable. The matched case will print the function.
How can I fix the issue? Thanks for your concern.