Python

45 articles in this topic

Python Generators and Iterators Tutorial: yield, next() and Lazy Evaluation

Build Python's iterator protocol from a three-value list, trace generators one request at a time, and practise safe one-pass pipelines with exact outputs.

Updated 18 Sep 20265 min readPython

Introduction to Python: Core Concepts, Worked Trace and Exam Patterns

Build a reliable Python tracing method from names and types to loops and mutable lists. Follow one function across every iteration and check its exact output.

Updated 16 Sep 20266 min readPython

Python Classes and Objects Tutorial: Build a Student Model Step by Step

Build one Student class, create independent objects, and trace every value. The examples show how constructors, methods, and attribute lookup work in Python.

Updated 15 Sep 20265 min readPython

Python Tokens, Variables, Data Types and I/O: Worked Examples from Input to Output

Trace one Python program from keyboard text through name binding, numeric conversion, a Boolean decision and formatted output, then test the common traps.

Updated 14 Sep 20265 min readPython

Python Lambda and Higher-Order Functions: Runnable Examples, Traps, and Exercises

Build lambdas from ordinary functions, pass them into higher-order operations, and trace a complete Python data pipeline. Then fix common errors and test yourself with runnable exercises.

Updated 12 Sep 20265 min readPython

Python Comprehensions Tutorial: List, Set and Dictionary Examples

Learn to read Python comprehensions in execution order, choose the right output collection, trace nested forms, and repair common syntax mistakes with runnable examples.

Updated 11 Sep 20266 min readPython

Python File Handling and Data Analysis: A Complete Worked Guide

Follow one Python standard-library program from safe CSV reading and row validation to exact topic summaries, rejected-row tracking, and reproducible output files.

Updated 9 Sep 20265 min readPython

Introduction to Python: Syntax, Execution and Worked Examples

Build a reliable Python mental model, then trace values, branches, loops, aliases and a five-score function without skipping a state change.

Updated 8 Sep 20266 min readPython

Python Collections and Strings: Complete Guide with a Worked Word Counter

Choose the right built-in Python container, trace aliases and slices correctly, and combine all five types in a worked word-counting pipeline.

Updated 6 Sep 20266 min read97 viewsPython

Loops in Python: for, while, range(), break and continue

Learn to predict Python loop output one pass at a time, choose the right loop, and avoid boundary, update, and list-modification errors.

Updated 5 Sep 20266 min readPython

Python Loop Patterns and Idioms: A Practical Tutorial

Move beyond manual counters and fragile flags. Learn the Python loop idioms that make iteration, filtering, aggregation, pairing, and search easier to read.

Updated 3 Sep 20265 min readPython

Functions in Python: Parameters, Return Values, Scope and Examples

Build, call and debug Python functions through traced examples. Learn how arguments, local scope and return values work, then test yourself with short exercises.

Updated 2 Sep 20265 min readPython