Ranges

Indices and tables

Background

Although relatively simple objects, range objects are frequently used to create loop indices, and starting data for other object types.

Exercise

  1. Initialize a tuple object with the values from 0 to 9 inclusive.
  2. Initialize a list object with the values from -1 to -9 inclusive.
  3. Create a list of indices with every 4th value from 0 to 20 inclusive.

Hints

Solution

When you are ready to see one possible solution, download and open this Jupyter Notebook file