Download
Go to python.org/downloads and install the latest Python 3 version.
Windows tip: on the first installer screen, tick "Add python.exe to PATH". Without it, the python command will not work in the terminal.
Check the installation
- Windows:
python --version(orpy --version) - macOS / Linux:
python3 --version
The interactive shell
Type python (or python3) to open the shell (>>>). Type code and see results immediately. Exit with exit().
Run a file
Save code as hello.py and run python hello.py.
Editors
- VS Code with the Python extension (most popular)
- PyCharm (full IDE)
- IDLE — comes with Python, good for quick tests
- Jupyter Notebook — popular for data science
You can also practise online without installing anything.
Example
Example — Check and run
Bash
# Check the version (Windows)
python --version
# Python 3.13.0
# macOS / Linux
python3 --version
# Interactive shell
python
>>> 7 * 6
42
>>> "python".upper()
'PYTHON'
>>> exit()
# Run a file
python hello.py
If --version prints a Python 3 version, the installation works. Each line typed at >>> runs immediately.