Module 5
Looping through lists
Visiting each item in a list.
Visiting every item
You can loop through a list just like you loop through a string. The loop variable takes each value in order.
Python
samples = ["control", "treatment", "blank"]
for s in samples:
print(s)→ control
treatment
blank
Your task
Loop through a list
- Loop through the list and print each item.