Skip to content
Learn Netverks

Lesson

Step 1/36 3% through track

intro

Introduction to Python

Last reviewed May 28, 2026 Content v20260528
Track mode
server_script
Means
Server runner
Reading
~4 min
Level
beginner

This lesson

An orientation to the Python track—how the compiled playground works, core vocabulary, and what you will practice next.

You need a clear map of the Python track so indentation, mutability, imports, and the stdlib do not feel like magic.

You will apply Introduction to Python in contexts like: Scripts, Django/FastAPI apps, notebooks, and glue code between systems.

Write Python 3 in the editor and click Run on server—the dev runner executes your script with print() for output; stdlib only in playground snippets (LEARNING_RUNNER_ENABLED=true). Also read the interview prep blocks.

Excellent first language—finish JavaScript basics if you already know the web, then Django for server-rendered apps.

How this Python track works

  • Python 3 in the playground — write runnable scripts; the dev runner executes with python3. Use print() for output—no console.log or System.out.println.
  • Language fundamentals focus — this track teaches Python syntax, data structures, OOP, stdlib, and modern features. Web frameworks live in the Django track after you finish here.
  • Prerequisites — finish JavaScript (variables, functions, control flow). Java or C# help compare OOP and typing models.

Multi-file packages, pip-only third-party libraries, and Jupyter notebooks run locally—lessons keep runnable snippets to stdlib and print() where the sandbox requires it.

Install on your device (macOS, Linux, Windows)

Install Python 3.11+ locally for notebooks and frameworks; the on-site playground uses the dev runner when enabled.

macOS

  1. brew install python@3.12 or install from python.org (check “Add to PATH” on installers).
  2. Create a project folder: mkdir ~/python-practice && cd ~/python-practice.
  3. python3 -m venv .venv && source .venv/bin/activate
  4. pip install --upgrade pip

Linux

  1. Debian/Ubuntu: sudo apt update && sudo apt install -y python3 python3-pip python3-venv
  2. Fedora: sudo dnf install -y python3 python3-pip
  3. python3 -m venv .venv && source .venv/bin/activate
  4. pip install --upgrade pip

Windows

  1. Install from python.org and enable Add python.exe to PATH.
  2. Or: winget install Python.Python.3.12
  3. PowerShell: py -3 -m venv .venv; .\.venv\Scripts\Activate.ps1
  4. pip install --upgrade pip

Verify: python3 --version (or py --version on Windows) shows 3.11+.

Run code on this site (Backend & language playgrounds)

  1. Clone or open this project locally; copy .env.example to .env.
  2. Ensure LEARNING_RUNNER_ENABLED=true and LEARNING_RUNNER_URL=http://127.0.0.1:9999/v1/execute.
  3. Terminal 1: php artisan serve (or composer run dev for Laravel + Vite + runner together).
  4. Terminal 2: npm run runner — keep it running while you click Run on server.

Python is a high-level, dynamically typed language known for readable syntax and a vast standard library. It powers web backends, automation, data science, machine learning, and scripting—making it one of the most versatile first languages after JavaScript.

How this track differs from JavaScript and Java

After the JavaScript track, you know variables, functions, and dynamic typing in the browser. Python shares dynamic typing but uses indentation instead of braces, print() instead of console.log, and runs on CPython—not in the browser by default.

Compared to Java or C#, Python skips explicit type declarations (optional type hints come later), compiles to bytecode at runtime, and uses duck typing. Web frameworks like Django live in the separate Django track after this language foundation.

What you will learn

  • Syntax: variables, strings, control flow, functions, and modules
  • Data structures: lists, tuples, dicts, sets, comprehensions, and slicing
  • OOP: classes, inheritance, dunder methods, and dataclasses
  • Stdlib: file I/O, JSON/CSV, pathlib, datetime, itertools
  • Modern Python: type hints, context managers, decorators, pytest, venv

Playground setup

This topic uses the server_script profile: the runner executes your script with python3. Use print() for output—stdlib modules are fine; third-party pip packages need local setup.

Important interview questions and answers

  1. Q: What executes Python code?
    A: CPython reads source, compiles to bytecode, and runs it on the Python virtual machine with automatic memory management.
  2. Q: Why learn Python after JavaScript?
    A: You transfer function and control-flow thinking, then gain scripting, data structures, and backend career paths—including Django after this track.

Self-check

  1. In one sentence, what is CPython?
  2. Where does Django belong in this curriculum?

Tip: Finish JavaScript first—Python builds on familiar functions and control flow with indentation and print().

Interview prep

What is Python in one sentence?

A high-level, dynamically typed language emphasizing readable syntax, automatic memory management, and a rich stdlib—widely used for web, data, and automation.

Why learn Python after JavaScript?

JavaScript teaches functions and dynamic typing in the browser; Python transfers that thinking to servers, CLIs, and data—with a path to Django after this track.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Why Python first?
  • Script vs app goal?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump