Skip to content

KevinWMatthews/python-iterators

Repository files navigation

Introduction to Iterators in Python

Exploration of Python iterators and how they work.

Supporting content for this blog post.

Background

Python provides for loops for looping over a collection of items. Iterators are the supporting concept that makes this work. These example scripts illustrate Python-level details of how this works.

Setup

Requries python3. For convenience, you can create a virtual environment:

$ virtualenv venv -p python3
$ source venv/bin/activate

but stock Python3 is sufficient.

Run

$ python3 <script_name>
# or
(venv) $ python <script_name>

About

Introduction to Python iterators

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages