Python Course- Beginner #5

Print(“Hello World”) is giving me the following when I type $python
At line:1 char:9

  • $python
  •             ~~~~~~

Unexpected token ‘’ in expression or statment.

I’ve tried
etc. with no luck

Hi @wingsr34 are you running the python command from the same directory where your file is located?

I’m following the instructions. I type print(“Hello”), then ctrl S, then ctrl ~ and thats when I get the error at the bottom. I created the file in my D:/ and then opend the folder, and then opened the file in that folder and started from there.

$python gives me the same result. On the previous attempt I tried $Pythonfile

Firstly, you should not type $python Just python If this does not work, please enter python --version in this terminal window and post the result. Also if you can post the result of ls

Ok, it all works. First, I was using the wrong quick keys. Maybe VSC updated or changed their quick keys from the time Mosh recorded his video? But it runs using ctrl + f5 or typing python as you mentioned.

Moving on.
Thanks for the help Paul.

1 Like

Hello i am getting the same if i want the output. But if i right click and click on “run python file in terminal” am getting the output. attached screenshot

can you please guide me on above comment?

Looks like python is not installed on your computer? If you did install python, then find the directory it was installed to and add the /bin folder to your PATH variable.