Looping Through a List
Visit each item in your list.
Looping Through a List is a free Coding for Kids lesson on CoddyKit. This is lesson 4 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 Coding for Kids learning path, and your progress syncs across the web and the CoddyKit app. The Coding for Kids course includes 4 lessons in total.
Visiting Every Item 🚶
Hello, list explorer! 🗺️ What if you want to do something with EVERY item in a list? A loop can visit each one! 🎉
The for-in Loop 🔁
We use for item in list: to go through a list. It grabs each item one at a time!
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
print(fruit)One Item at a Time 1️⃣
The loop gives us each item, one by one. First apple, then banana, then cherry! 🍎🍌🍒
pets = ["dog", "cat", "fish"]
for pet in pets:
print(pet)Pick Any Name 🏷️
The word after for is your choice! for animal in animals reads nicely. 😄
animals = ["lion", "tiger", "bear"]
for animal in animals:
print(animal)Say Something Nice 💬
We can use each item in a friendly message inside the loop!
fruits = ["apple", "banana"]
for fruit in fruits:
print("I love " + fruit + "!")Loop Through Numbers 🔢
Lists of numbers work too! The loop visits each number.
scores = [10, 20, 30]
for score in scores:
print(score)No Counting Needed! 🎯
The best part: you do NOT need positions or numbers. The loop handles every item for you! 🙌
colors = ["red", "green", "blue"]
for color in colors:
print(color + " is pretty!")Greet Everyone 👋
Let us say hi to every friend in our list!
friends = ["Mia", "Leo", "Zoe"]
for friend in friends:
print("Hi, " + friend + "!")Count While Looping 🔢
We can even count items as we go using a counter that grows!
toys = ["ball", "car", "kite"]
count = 0
for toy in toys:
count = count + 1
print("Total toys: " + str(count))Star for Each Item ⭐
Print a star for every item in the list!
wins = ["game1", "game2", "game3"]
for win in wins:
print("⭐ " + win)You Visited Them All! 🎉
Awesome! Try looping through your own list of favorite snacks.
snacks = ["chips", "candy", "fruit"]
for snack in snacks:
print("Yum: " + snack)Quick Check 🧠
Quiz time! 🎯 What does for item in list: do?
Recap Time! 🌟
Explorer complete! 🎓 Today you learned:
for item in list:visits each item- You get items one at a time
- No positions or counting needed
- Pick any helper name you like!
You are a list-looping legend! 🏆
Learn Python with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 35
- Lessons
- 140
Frequently Asked Questions
Is the “Looping Through a List” lesson free?
Yes — the full text of “Looping Through a List” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO. The Coding for Kids course includes 4 lessons in total.
What will I learn in “Looping Through a List”?
Visit each item in your list. You practise Coding 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 Coding for Kids?
No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 4 of 4.
How long does the “Looping Through a List” 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 Coding for Kids lesson?
Yes. Every Coding 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
- What Is a List?
- Getting Items by Position
- Adding and Removing Items
- Looping Through a List