Python

Learn Python programming from scratch

344 tutorials
12 of 344 tutorials
Jul 10, 2026· 7 min read

Nested Functions in Python

Learn how to define functions inside other functions in Python, why nesting is useful for encapsulation and factories, and how inner functions access outer variables.

PythonIntermediateFunctions
Jul 10, 2026· 7 min read

Closures in Python

Learn what closures are in Python, how they capture variables from enclosing scopes, and how to use them for function factories, callbacks, and state encapsulation.

FunctionsIntermediatePython
Jul 10, 2026· 7 min read

Function Annotations in Python

Learn how to annotate function parameters and return values in Python, what annotations are used for, and how they improve code readability and tooling support.

PythonFunctionsIntermediate
Jul 10, 2026· 7 min read

Document Python Functions with Docstrings

Learn how to write effective docstrings for Python functions, the PEP 257 conventions, and how tools like help() and Sphinx use them to generate documentation.

FunctionsIntermediatePython
Jul 10, 2026· 7 min read

First-Class Functions in Python

Learn what it means for Python functions to be first-class objects: you can assign them to variables, pass them as arguments, and return them from other functions.

FunctionsPythonIntermediate
Jul 10, 2026· 7 min read

Use Python Functions as Callback Arguments

Learn how to pass Python functions as callbacks, how callback patterns work in event-driven and asynchronous code, and when to use callbacks versus other approaches.

PythonIntermediateFunctions
Jul 10, 2026· 6 min read

Import Modules in Python

Learn how the Python import statement works, where Python searches for modules, and how to avoid common import pitfalls like naming conflicts and circular dependencies.

PythonIntermediatemodules-packages
Jul 10, 2026· 6 min read

Polymorphism in Python Explained

Learn what polymorphism means in Python, how different classes can share the same interface, and how to write code that works with objects of any type that support the required operations.

Object-Oriented ProgrammingPythonIntermediate
Jul 10, 2026· 6 min read

Duck Typing in Python

Learn what duck typing means in Python, how it lets you write flexible code that works with any object that supports the right methods, and when to embrace or avoid it.

IntermediateObject-Oriented ProgrammingPython
Jul 10, 2026· 6 min read

Abstraction in Python Explained

Learn what abstraction means in Python OOP, how to hide complexity behind simple interfaces, and how abstract classes and methods enforce design contracts.

Object-Oriented ProgrammingPythonIntermediate
Jul 10, 2026· 7 min read

Composition vs Inheritance in Python

Learn when to use composition over inheritance in Python, how to delegate work to contained objects, and why 'has-a' relationships often beat 'is-a' for flexible design.

IntermediatePythonObject-Oriented Programming
Jul 10, 2026· 6 min read

Object Comparison in Python

Learn how Python compares objects using equality, identity, and rich comparison methods, and how to implement custom comparison logic for your classes.

Object-Oriented ProgrammingIntermediatePython