I'm new to Python, and I'm trying to compile a VERY simple code in Python (using Atom editor), and after I run this code:
name = input("Name:")
print(f"hello, {name}")
And after typing in any name (in this case I simply typed in n
, I get this error message:
Name:n
Traceback (most recent call last):
File "hello_name.py", line 1, in <module>
name = input("Name:")
File "<string>", line 1, in <module>
NameError: name 'n' is not defined
I hope you can help! Thanks!
input(..)
is equivalent toeval(raw_input(..))
so it evaluates the input as if it is a Python expression. But anyway, Python-2.x is no longer supported since January 1, 2020$ python3
.