Skip to main content
🐍

Python Foundations

L1· 174 lessons

From zero to confident with Python basics

0 / 174 · 0%

174 interactive lessons split into 8 modules covering print/variables, types, conditions, loops, lists, dicts, functions, strings, errors, and real-world mini-projects. First 15 lessons free, no signup.

Who this is for

  • ·Never programmed before — this assumes literally zero coding background
  • ·You don't need a Mac. Browser is enough. We provide the Python runtime
  • ·Math: high-school arithmetic is plenty. No calculus, no proofs
  • ·English not required — most lessons localised to many languages, pick yours in the header

After you finish

📖 topic_overview_labelLearn Python free

0/522 stars· 0% complete

Resume →

Hello, World!

Variables

FREE

Data types

FREE

Strings

FREE

Numbers and math

FREE

User input

FREE

Currency converter

FREE

if / else conditions

FREE

Find the bug in the if

FREE

Even or odd

FREE

Grade calculator

FREE

for loops

FREE

while loops

FREE

FizzBuzz

FREE

Shopping list

FREE

🎯 Review · 15-lesson recap

FREE

Contacts dict

Greeting function

Predict the output

List comprehensions

Guess the number

Predict: print with comma

Predict: math

Predict: for loop

Predict: f-string + variables

List & append — write code

Quiz: which type is immutable?

Quiz: what does len() return?

Division // and % — write code

Quiz: comments in Python

Quiz: what does a function without return return?

🎯 Review · build + look up a contact book

Double a number

Maximum of three

Reverse a string

Sum of a list

Count vowels

Predict: `in` operator on strings

Quiz: how do str and int differ?

🎯 Mini-project: Guess the number

Predict: conditions with and/or

Find the bug: loop

Fill in: nested loop

Default parameters

Predict: variable scope

Find the bug: forgotten return

Quiz: what does .lower() return?

Fill in: lambda

🎯 Review · text stats with functions

Replace a word

Split a sentence

Predict: slice [::-1]

Quiz: which method strips whitespace?

Capitalise words in a title

🎯 Mini-project: Word frequency counter

try / except — catch the error

Find the bug: int() on a string

Quiz: what error fires on a missing dict key?

Predict: try / finally

Safe number parsing

Find the max in a list

Filter: only evens

Count words in text

Mini calculator

FINAL: TODO-list mini-project

🎯 Review · safe CSV parser

List comprehensions

Dict comprehensions

enumerate()

zip()

*args — variable arguments

**kwargs — keyword arguments

Lambda functions

sorted() with key=

Predict: map and filter chained

F-strings: formatting deep dive

String split() and join()

String strip() and replace()

Scenario: process a CSV export at midnight

Scenario: parse a webhook payload

Fix: bare except swallows real bugs

🎯 Mini-project: Calculator with history

Scenario: validate user age at signup

Fix: a wrong type hint that mypy would catch

Predict: list slicing tricks

Counter from collections

Set operations

Classes: defining your own type

Class methods and static methods

Inheritance

super(): calling the parent

Magic methods: __str__ and __eq__

Properties with @property

Class vs instance variables

isinstance and type checks

Generators with yield

Generator expressions

Decorators

Closures

Context managers (with)

Regex basics with re

datetime: working with dates

🎯 Mini-project: JSON → CSV converter

pathlib for files

defaultdict

namedtuple

Dataclasses

MILESTONE: build a Library system

functools.lru_cache

functools.partial

itertools.chain and product

Enum.Enum

Logging basics

Ternary expressions

Walrus operator :=

Tuple unpacking + swap

any() and all()

min/max with key=

is vs ==

Truthy and falsy values

Mutable default args trap

abs / round / divmod

Conditional unpacking

🎯 Mini-project: Log parser

String case methods

String startswith / endswith

in operator and not in

Dict get() with default

MILESTONE: Phone book CLI

asyncio basics: async/await

asyncio.run() — top-level entry

asyncio.gather() for parallel coroutines

Predict: asyncio.sleep ordering

async with / async for

Threading basics — predict the output

threading.Lock — predict the final counter

queue.Queue — producer / consumer

multiprocessing.Pool — predict the output

ThreadPoolExecutor — predict the output

subprocess.run — predict the output

shutil copytree — predict

tempfile cleanup — predict

urllib status code — predict

requests raise_for_status — predict

timeit for micro-benchmarks

cProfile basic profiling

logging vs print

argparse for CLI tools

CAPSTONE: Parallel file downloader

__init__ vs __new__

@property — computed attributes

super() chaining in inheritance

Multiple inheritance and MRO

ABC — abstract base classes

decimal.Decimal — precise arithmetic

frozenset — immutable, hashable sets

Custom exceptions + raise from

@contextmanager decorator

yield from — generator delegation

collections.Counter — frequency counts

functools.singledispatch — type-based dispatch

Type hints — Optional, Union, generics

pathlib — modern path handling

datetime arithmetic

JSON — dump, load, custom encoder

CSV with DictReader / DictWriter

argparse mini-CLI

logging — handlers, levels, formatters

CAPSTONE: CLI todo-app

MINI: Tic-Tac-Toe — detect a winner

MINI: Log parser — top 3 IPs by error count

MINI: Password strength validator (5-rule scoring)

MINI: Calculator with history (last N results)

MINI: JSON → CSV converter (flatten nested dicts)

Tip: click any lesson to revisit it. After your first attempt, the “Show example” button reveals the full solution.