agyanadda@gmail.com

Python Installation

Python Basics 1 min read Updated Dec 4, 2026 Topic 2 of 32

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 (or py --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.

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which option must be ticked in the Windows installer?

Exercise 2 True / False

Python files use the .py extension.

Exercise 3 Fill in the Blank

Leave the interactive shell by typing ___()

Frequently Asked Questions

Python is not on your PATH, so Windows offers the Store version. Re-run the python.org installer, choose Modify, tick Add Python to environment variables, or use the py launcher command instead.