Book a free demo

๐Ÿ’ก Interactive lessons ยท free, no sign-up

Python lists, and the index that starts at 0

Play Python Lists and Indexes

Loading Python Lists and Indexesโ€ฆ

Slide an index along a list and see which item you get, including counting from the back. Learn what causes an IndexError.

ShareWhatsApp

How to play Python Lists and Indexes

  1. Read the first step: a list is a row of boxes, each with an index.
  2. Move the sliders and switches to change the diagram and watch what happens. The readout under the picture shows the numbers.
  3. Answer each question. If you are wrong you get a hint and can try again, with no penalty.
  4. Some steps ask you to make something happen, such as hitting a target value. Experiment until it works.
  5. Finish the lesson to earn XP and see how many questions you got right first time.

Tips and strategy

  • Do not rush. The controls are there to be played with, so try extreme values as well as sensible ones.
  • Say what you notice out loud or write it down before you press Continue.
  • Use the hint when you are stuck, and then try to explain the answer in your own words.
  • Count from 0, and remember the last index is one less than the length.

Keep playing

More games you might like

All 116 games โ†’

FAQ

Python Lists and Indexes: questions

Why does a Python list start at index 0?

Python counts how far an item is from the start, so the first item is 0 steps away. Most programming languages do the same.

What does a negative index do?

It counts from the end of the list: -1 is the last item, -2 is the one before it.

What causes an IndexError?

Asking for an index outside the list, such as index 5 in a list of 5 items (valid indexes are 0 to 4).

What age is this lesson for?

It suits ages 10 to 16 as a first step in Python.

Start a conversation

Questions about classes?

A parent or guardian can share the learner's age, level and goals, and we'll suggest a starting point and confirm the format before anything is booked.

  • Tell us the learnerโ€™s age or grade and goals
  • Weโ€™ll suggest a suitable class or learning path
  • Weโ€™ll confirm format, timing and fees with a parent or guardian

For a childโ€™s class, please have a parent or guardian send the enquiry. Avoid sharing passwords or sensitive personal details.

Weโ€™ll use your details only to respond to this request.

Chat on WhatsApp
Esc

Try