In this guide we've looked at various ways to work with lists as well as had an introduction to list comprehensions, iterators, and generators.
The MicroPython port of the itertools module has a few other functions that we haven't mentioned. If your interest is piqued, have a look at the code and the CPython docs linked earlier.
Iterators are often called streams and are incredibly useful things. If you have an understanding of the Scheme language, The Structure and Interpretation of Computers Programs has a really good section on streams and their uses. If you don't have that understanding, the book (and accompanying lecture videos) is a great way to gain it.
Text editor powered by tinymce.