We will use Python 3 which is the latest Python version. If you have already installed Python 3, please skip this section. If you have Python 2 in your machine, please upgrade to Python 3.
Click the following link to visit the Python Downloads page https://www.python.org/downloads/
Under the Downloads dropdown list, select the OS
Click the downloading link based on the operating system you are using:
Note: While creating this document the latest version was 3.10.4. You might see an advanced version. Download the latest version.
Perform the installation process:
Click on Download Python 3.10.4 (you might see a different version). If you are using Windows, an
.exefile will get downloaded. If you are using Mac, a
.pkgfile will get downloaded. After downloading the files, follow the instructions on your screen to install Python.
After the installation, open Visual Studio Code. Then, open the terminal from VS Code by hitting the
~key. Type the following command to test your Python version:
$ python3 --version
Note: you are supposed to see the Python version (it may be slightly different from the version shown here, but it should be 3.x.x).
The Python extension is also recommended to install in VS Code.
Click on View -> Extension in the VS Code menu
Search Python and click the install button on the right