Skip to content
AITroveRead. Build. Understand.

Python Tutorial

Operation contracts, checked Python programs and connected learning resources.

Python programs operate on objects with explicit input, ownership and failure contracts.

Learning roadmap

This section contains 39 written lessons or quiz banks. Programs are verified on CPython 3.14.6. Standard-library lessons target 3.11+ syntax; lessons using data, web, machine-learning or testing packages state their tested dependencies separately. Framework programs use local test clients, not a deployed service. Read the stated limits before adapting a fixture into an application.

Interpreter and values

Read the contract, run its program and inspect the failure case.

Functions and failures

Read the contract, run its program and inspect the failure case.

Sequence expressions

Read the contract, run its program and inspect the failure case.

Object state

Read the contract, run its program and inspect the failure case.

Scope and call boundaries

Read the contract, run its program and inspect the failure case.

Bounded nested input

Read the contract, run its program and inspect the failure case.

Input, iteration and function tools

Read the contract, run its program and inspect the failure case.

Source names, callable dispatch and preserved startup contracts

Read the contract, run its program and inspect the failure case.

Stable rejection and explicit calls

Read the contract, run its program and inspect the failure case.

Unpacking and evaluation

Read the contract, run its program and inspect the failure case.

Pull loops and sentinels

Read the contract, run its program and inspect the failure case.

Strictly paired feeds

Read the contract, run its program and inspect the failure case.

Continue learning

Move between tutorial, collections, advanced material and practice using the subject tabs. The sidebar changes with each section; related examples keep one canonical lesson URL.

Runtime and integrity contracts

Export, network and command contracts

Test this contract in the Python concurrency and storage boundary quiz.

Test this contract in the Python I/O and algorithm boundary quiz.

Process and data contracts

Check the process and data boundary quiz.

Lifetime and I/O contracts

Check the lifetime and I/O quiz.

Python 3.13 and 3.14 library contracts

Check the versioned runtime quiz.

Runtime and observability contracts

Check the runtime and observability quiz.

Native and platform boundaries

Check the native and platform quiz.

Bounded streams and storage controls

Check the stream and storage quiz.

Received data and owned local I/O

Check the received-input quiz.

Cross-thread scheduling and cleanup lifetime

Check the thread and async lifetime quiz.

Standard-library state and ownership contracts

Check the standard-library state quiz.

Curriculum

Read the contract, run its program and inspect the failure case.

  1. 1Python recursion: bound depth instead of raising the limit

Read the contract, run its program and inspect the failure case.

  1. 1Python iter(callable, sentinel): stop a pull loop at a declared marker

Read the contract, run its program and inspect the failure case.

  1. 1Python zip(strict=True): reject a mismatched pair of input feeds
Storage details