I am having difficulty understanding the concept in my book. I tried the coding example the book told me to try, but I get this NameError that I do not understand why it is an error.
This is my code:
name = input('What is your name?')
print(name)
This is my error message:
File "/Users/eric/Python Notes/Notes.py", line 1, in <module>
name = input('What is your name?\n')
File "<string>", line 1, in <module>
NameError: name 'eric' is not defined
Edit: Thank you everyone who helped me understand this error. By default, Geany and VSCode were using Python2 as my interpreter. Changing it to Python3 fixed the problem. The raw_input() is correct also, because it is the correct syntax for Python2.