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:
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:
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:
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:
- fruits.append("grape") # Adds "grape" to the end of the list
- fruits.remove("cherry") # Removes "cherry" from the listTry 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
Lists - Easy Challenge
Start with the basics. Perfect for beginners!
Lists - Medium Challenge
Get more challenging. Build your confidence!
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!
Keep learning
- ← Previous lessonLesson 2: Parameters & ReturnsPass data to functions
- Next lesson →Lesson 4: DictionariesKey-value data storage
- Grade 8 courseJavaScript Basics - Web ProgrammingJavaScript coding course for kids.
- Student ToolsFree calculators for studentsPercentage, fraction, ratio and marks calculators with steps.
- CBSEClass 7 CBSE & NCERT study materialMaths, Science and Computer chapters with solutions.
- Future SkillsExplore future skillsAI, robotics and new-age skills explained for students.