Skip to content

Summary

This subject explains core programming ideas through Python examples and exam-style revision notes.

Main themes

  • Data types and collections
  • Higher-order functions
  • Core constructs such as conditionals, loops, and comprehensions
  • Iteration and lazy evaluation through generators
  • Anonymous functions and lambda calculus
  • First-class functions and closures
  • Type discipline and type hints
  • Type inference in tools
  • User-defined types
  • Concrete types
  • Recursion
  • Operational semantics
  • Shared behavior through protocols and duck typing
  • Polymorphism and generic code

What to remember

  • Python is flexible, but good structure still matters.
  • Functions can be values.
  • Type hints improve clarity even in a dynamically typed language.
  • Custom types make programs easier to read and maintain.
  • Recursion, generators, and polymorphism are reusable patterns, not isolated tricks.

Fast exam line

If you need one sentence for the whole subject, say:

Programming from First Principles teaches how Python programs are built from values, functions, types, control flow, recursion, and reusable abstractions.

Built from Markdown with VitePress.