Could you please tell me why I am getting this error? When I enter the input I am expecting a string but I get the below error instead,
File "ifelif.py", line 1, in <module> first_name = input("What is your first name? ") File "<string>", line 1, in <module> NameError: name 'Caitlin' is not defined
I am using this code:
first_name = input("What is your first name? ")
print("Hello,", first_name)
if first_name == "Caitlin":
print(first_name, "is learning Python")
print("Have a great day {}!".format(first_name))
When I enter the name in the Terminal with quotes to make a string, it works but I get 2 strings instead of 1 string :
('Hello,', 'Ed')
The name of the file is 'ifelif.py'
Many thanks!