Python

Learn Python programming from scratch

344 tutorials
12 of 344 tutorials
Jul 11, 2026· 6 min read

Python Iterator Protocol Explained

Learn how Python's iterator protocol works with the __iter__() and __next__() methods, and understand the contract every iterator must follow.

PythonIntermediateIterators
Jul 11, 2026· 6 min read

Create Custom Iterators in Python

Learn how to build your own iterators in Python by implementing the __iter__() and __next__() methods, with practical examples and reusable patterns.

PythonIteratorsIntermediate
Jul 11, 2026· 5 min read

Python `iter()` Function Explained

Learn how Python's built-in iter() function works, its single-argument and two-argument sentinel forms, and how to use it with custom objects and external data sources.

PythonIntermediateIterators
Jul 11, 2026· 5 min read

Python `next()` Function Explained

Learn how Python's built-in next() function retrieves items from iterators, how to handle exhaustion with default values, and how manual iteration works under the hood.

PythonIntermediateIterators
Jul 11, 2026· 6 min read

Create Python Generator Functions with `yield`

Learn how to write generator functions in Python using the yield keyword, with practical examples ranging from simple counters to data transformation pipelines.

PythonIntermediateIterators
Jul 12, 2026· 7 min read

Python `collections` Module Explained

Learn how to use Python's collections module for specialized container types like Counter, defaultdict, OrderedDict, deque, and namedtuple.

Python