Installing Python & IDE Setup
Before writing Python code, you need to install Python and set up a code editor (IDE). This topic walks you through installing Python 3.12+ and setting up VS Code with the Python extension for a professional development experience.
Installing Python
Visit python.org and download the latest Python 3.x version. On Windows, check 'Add Python to PATH' during installation. On macOS/Linux, Python may already be pre-installed — check with 'python3 --version' in the terminal. Always use Python 3 (Python 2 is deprecated).
Everything in Python is an object — use type() to check
Setup Steps
- Download Python from python.org (latest 3.x version)
- Windows: Check 'Add Python to PATH' during install
- macOS/Linux: Python 3 may already be installed
- Verify: Run python --version or python3 --version in terminal
- Install VS Code from code.visualstudio.com
- Install the Python extension in VS Code
- Alternative IDEs: PyCharm, Jupyter Notebook, IDLE
Verify Installation
# Open terminal/command prompt and run:
# python --version (Windows)
# python3 --version (macOS/Linux)
# Start Python interactive mode:
# python or python3
# You should see something like:
# Python 3.12.0
# >>>
# Type your first command:
# >>> print("Python is installed!")
# Python is installed!
# Exit with: exit() or Ctrl+DTip
Tip
VS Code with the Python extension is the best free setup for beginners. It gives you syntax highlighting, auto-completion, linting, and a built-in terminal. Install it before anything else.
Common Mistake
Warning
On Windows, forgetting to check 'Add Python to PATH' during installation means you can't run python from the terminal. Reinstall and check that box if you missed it.
Practice Task
Note
Verify your setup: (1) Open terminal and type python --version. (2) Start the Python REPL with python and type 2+2. (3) Exit with exit(). (4) Create a hello.py file and run it.
Quick Quiz
Key Takeaways
- Before writing Python code, you need to install Python and set up a code editor (IDE).
- Download Python from python.org (latest 3.x version)
- Windows: Check 'Add Python to PATH' during install
- macOS/Linux: Python 3 may already be installed