8

Lesson 8 of 20 ยท Data & Lists

Data & Lists โ€” Part 16

Lists and loops. This is part 16 of 20.

What you'll learn

You will learn that lists store multiple values, and you access them by their index (starting at 0).

Steps

  1. 1A list holds multiple values in order. Here, items contains three fruits: apple, banana, orange.
  2. 2items[0] means 'the first item'. In coding, we count from 0! So items[0] is 'apple', items[1] is 'banana', items[2] is 'orange'.
  3. 3Lists are super useful โ€” think of a playlist (list of songs), a shopping list, or a leaderboard (list of scores).
  4. 4You can add items, remove items, and check how many items are in a list with len(). Lists grow and shrink as needed!

Key Terms

List
A collection of values in order. In Python: [a, b, c].
Index
The position of an item in a list. The first item is index 0.
len()
Returns how many items are in a list.
Python 3
Output
Loading Python... This may take a few seconds.

Your code runs only in your browser. No code is sent to any server. Stay safe and have fun learning!

๐Ÿ–จ๏ธ

Checkout complete lesson on Data & Lists for 7th Grade

Get the full Data & Lists track as a printable PDF โ€” all lessons, worksheets, and answer keys.

View in Shop

Your Cart (0)

Your cart is empty

Browse our shop to find activities your kids will love

Data & Lists โ€” Part 16 โ€” Data & Lists | 7th Grade Coding | LittleActivity | LittleActivity