Turning Learners Into Developers
Codekilla
CODEKILLA
back to course
Lesson 02 / 1142%· free preview
Getting Started2/5

Python Get Started

Install Python, run your first file.

Definition

Getting started with Python means installing the interpreter, choosing an editor, and learning how to execute a .py file. Python ships pre-installed on macOS and most Linux distros; on Windows you grab it from python.org. Once installed, two commands cover 95 % of your workflow: python --version to verify it's working, and python yourfile.py to run a script.

Installing Python

Windows: Download the installer from https://python.org/downloads — check Add Python to PATH before clicking Install Now.

macOS: brew install python (recommended) or use the python.org installer.

Linux: It's almost certainly already installed. Run python3 --version to check.

Verify your install in a fresh terminal:

bash
python --version       # or: python3 --version
Setting Up VS Code
  1. Install Visual Studio Code: https://code.visualstudio.com
  2. Install the official Python extension from Microsoft (Ctrl+Shift+X → search Python).
  3. Open any folder, create a new file hello.py, and VS Code will offer to pick the interpreter. Optional but recommended: also install Pylance for smart auto-complete and Python Indent for clean blocks.
Writing Your First Code

Create a file called hello.py and paste:

python
# hello.py — your first Python program
print("It works!")
print("Today's lesson:", "Get Started")
Running the Program

Method 1 — Terminal (works everywhere)

bash
python hello.py

Method 2 — VS Code Run button (top-right ▶ triangle once Python extension is installed).

Method 3 — Codekilla compiler at /compiler — paste, click Run.

Output
It works!
Today's lesson: Get Started
The Python REPL

Run python with no arguments to drop into the interactive shell:

>>> 2 + 3
5
>>> name = "Asha"
>>> f"Hello, {name}"
'Hello, Asha'
>>> exit()

The REPL is amazing for prototyping. Ctrl+D (Linux/macOS) or exit() leaves the shell.

Pro Setup — Virtual Environments

Always isolate project dependencies with a virtual environment:

bash
python -m venv .venv         # create
source .venv/bin/activate    # macOS / Linux
.venv\\Scripts\\activate     # Windows
pip install requests         # installs only into this venv
Key Takeaways
  • Verify your install with python --version (or python3 --version).
  • Run any script with python yourfile.py.
  • VS Code + Python extension is the fastest beginner setup.
  • The REPL (python with no args) is your live calculator.
  • Use python -m venv .venv for every new project — keeps dependencies tidy.
Interview Questions

Practice Questions
  1. Install Python and confirm python --version shows 3.10 or higher.
  2. Create intro.py that prints your name and the current date (from datetime import date; print(date.today())).
  3. Open the REPL and compute (1024 ** 2) — confirm it's 1,048,576.
Pro Tips
  • Close and reopen any terminal that was running before you installed Python — PATH only refreshes on new shells.
  • On Windows, save files with .py extension — Notepad sometimes secretly adds .txt.
  • Never edit Python files in Microsoft Word — it adds invisible characters that break the parser.
AI-powered recap

Quick recap quiz?

We'll generate 5 MCQs from this lesson and check your understanding instantly. Takes ~30 seconds.

Ready to move on?
// example library
Want more hands-on snippets in Python?
Browse 3 runnable examples · across 1 chapter · short, copy-paste-friendly · grouped by topic
Explore examples
// deep-dive
Go deeper — hand-picked articles
Long-form guides, shortcuts, and mental models that won't fit in a single lesson.
Open Blog
// feedback.matters()
Did this lesson help you?