💡 What You'll Learn
Combine for loops with lists to process each item. Use for item in list: to visit every item. You can also use enumerate() to get both index and value.
for_list.py
1colors = ["red", "green", "blue"]
2for color in colors:
3 print("I like", color)
📺 Loop through items!
Colors list: red, green, blue
Click to loop!
🎯 Your Challenges
1Sum Numbers
Add up all numbers in a list using a loop
2Find Maximum
Loop through to find the biggest number
3With Index
Use enumerate() to get index and value together
📚 What You Learned
for item in list:visits every item- The loop variable takes each item's value
enumerate(list)gives index and value- You can break or continue in list loops too