0Pricing
Python For Kids · Lesson

Lists and Tuples

Learn how to store multiple items in a single variable

Lists and Tuples is a free Python For Kids lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Python For Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

1

Lists and Tuples

Welcome to the Data Structures lesson! Today, we'll learn about two important ways to store multiple items in a single variable using lists and tuples in Python.

2

What are Lists and Tuples?

Lists and tuples are data structures that allow you to store multiple items in one place. They help organize data and make it easier to manage collections of related information.

  • Lists: Mutable collections, meaning you can change, add, or remove items.
  • Tuples: Immutable collections, meaning once created, you cannot modify them.

3

Creating a List

A list is created by placing items inside square brackets ([]), separated by commas.

Example:

# Creates a list of fruits
fruits = ["apple", "banana", "cherry"]

4

Accessing List Items

You can access individual items in a list by their index, starting from 0.

Example:

# Accesses the first fruit in the list
print(fruits[0])  # Output: apple

# Accesses the second fruit in the list
print(fruits[1])  # Output: banana

5

Modifying Lists

Since lists are mutable, you can add, remove, or change items after the list is created.

Example:

# Adds a new fruit to the list
fruits.append("orange")

# Changes the first fruit in the list
fruits[0] = "grape"

# Removes the second fruit from the list
fruits.pop(1)

# Prints the modified list
print(fruits)  # Output: ['grape', 'cherry', 'orange']

6

Creating a Tuple

A tuple is created by placing items inside parentheses (()), separated by commas.

Example:

# Creates a tuple of colors
colors = ("red", "green", "blue")

7

Accessing Tuple Items

Just like lists, you can access individual items in a tuple by their index.

Example:

# Accesses the first color in the tuple
print(colors[0])  # Output: red

# Accesses the third color in the tuple
print(colors[2])  # Output: blue

8

Why Use Lists and Tuples?

Lists and tuples help you organize data efficiently. Use lists when you need a collection that can change, and tuples when you need a collection that should remain constant.

  • Lists: Great for tasks like managing a list of items, updating information, or adding new elements.
  • Tuples: Ideal for storing fixed data, such as coordinates or days of the week.

9

10

Great Job!

You've learned how to use lists and tuples to store multiple items in Python. These data structures help you manage and organize data effectively in your programs. Keep practicing by creating your own lists and tuples and experimenting with their features!

Lists and Tuples — illustration 10

Frequently asked questions

Is the “Lists and Tuples” lesson free?

Yes — the full text of “Lists and Tuples” is free to read here on the web, and the Python For Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Python For Kids course, upgrade to CoddyKit PRO.

What will I learn in “Lists and Tuples”?

Learn how to store multiple items in a single variable You practise Python For Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Python For Kids?

No prior experience is required. Python For Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Lists and Tuples” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Python For Kids lesson?

Yes. Every Python For Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Lists and Tuples
  2. Dictionaries
  3. Sets
  4. Manipulating Data Structures
← Back to Python For Kids