I can't run my code in Visual Studio Code. When I type $ code hello.py then this happens:
2 Answers
In the image you have used code hello.py. You should instead use python hello.py. You can run on the command prompt only if you had "Add Python to Path" checked while installing the Python software.
If you are on a Mac
In Mac, Python 2.7 is automatically installed. If you want to use Python 3 then you have to manually install from the Python official website and use python3 hello.py to use Python 3.
Comments
Always remember that a Python file will be run by using this command: python yourfile_name.py.
In your image you are trying to run your Python file with this command: code hello.py
Instead of using code hello.py, try to change it with python hello.py.
python hello.pyinstead ofcode hello.py. Please consider checking my answer for more information