0

im trying to get myself into Python. And right in the beginning i am encountering this problem. What am i doing wrong? Is there something wrong with my setup? Pls help

I'm running Python 3.8.2 on macos using vscode.

Code:

name = input("Name: ")
print("hello, " + name + "!")

Error:

bashkim@Bashkims-MBP test % python name.py
Name: Bashkim
Traceback (most recent call last):
  File "name.py", line 1, in <module>
    name = input("Name: ")
  File "<string>", line 1, in <module>
NameError: name 'Bashkim' is not defined

Tried also following:

Code::

name = input()
print(f"hello, {name}!")

Error:

bashkim@Bashkims-MBP test % python name.py
  File "name.py", line 2
    print(f"hello, {name}!")
                          ^
SyntaxError: invalid syntax

enter image description here

Bashkim
  • 9
  • 1

0 Answers0