FireEdgeX
0

LESSON 04 ยท PYTHON

For loops and ranges

A for loop visits each item in a sequence or range.

5 min readIn progress

THE IDEA

Understand the concept

A for loop is an easy way to repeat work over a sequence. range(stop) produces numbers starting at zero and stopping before stop, so range(3) contains 0, 1, and 2.

WORKED EXAMPLE

See it in context

Example