TalentJR

Lesson 3

Lists

Store multiple items

1What is a List?✨

A list is a way to store multiple items in Python. You can think of it as a collection of things, like a shopping list or a list of your favorite movies!

2Why Use Lists?🎯

  • ✓ Store multiple values in one variable
  • ✓ Easy to organize and manipulate data
  • ✓ Access items using their position (index)
  • ✓ Can hold different data types together

3Creating a List💡

You create a list by placing items inside square brackets. Here's how to create a list of fruits:

💻 code
fruits = ["apple", "banana", "cherry"]

This tells Python to store three fruit names in the list called "fruits".

4Accessing List Items🚀

You can access items in a list using their index, which starts at 0. For example:

💻 code
print(fruits[0])

This will print "apple", the first item in the list.

5Modifying a List🔍

Lists are flexible! You can change items, add new ones, or remove them. Here’s how to change a fruit:

💻 code
fruits[1] = "orange"
print(fruits)

This changes "banana" to "orange" and shows the updated list.

6List Methods⭐

Python has built-in methods for lists that make it easy to work with them. Here are a couple of useful methods:

💻 code
- fruits.append("grape") # Adds "grape" to the end of the list
- fruits.remove("cherry") # Removes "cherry" from the list

Try adding and removing items from your list!

7What You'll Build This Grade🧩

  • ✓ Fun programs that manage lists of items
  • ✓ Games that use lists for scores or player names
  • ✓ Applications that organize data in creative ways
  • ✓ Projects that explore real-world data using lists

🎯 Practice Challenges

Master Lists by completing all 3 difficulty levels

🟢 EASY

Lists - Easy Challenge

Start with the basics. Perfect for beginners!

🟡 MEDIUM

Lists - Medium Challenge

Get more challenging. Build your confidence!

🔴 HARD

Lists - Hard Challenge

Master this concept. Prove your skills!

🏆 Study a lesson for 2+ minutes to earn +10 TalentJR Points a day. Badges, certificates & prizes →

Ready to Master Lists? 🚀

Complete the challenges, take the quiz and keep your learning streak going!