Looping Through a List
Visit each item in your list.
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)All lessons in this course
- What Is a List?
- Getting Items by Position
- Adding and Removing Items
- Looping Through a List