--- id: practical-python-1.20 source_exercise_id: "1.20" title: "Looping over list items" section: "1.5 Lists" source_path: "01_Introduction/05_Lists.md" source_repo: "https://github.com/dabeaz-course/practical-python" source_commit: "93dca856b41c61a0a0f85ae334116e4c125629ea" student_visible_solution: false has_private_solution: false skip: false --- # Exercise 1.20: Looping over list items > Source: Practical Python Programming, `01_Introduction/05_Lists.md`. ### Exercise 1.20: Looping over list items The `for` loop works by looping over data in a sequence such as a list. Check this out by typing the following loop and watching what happens: ```python >>> for s in symlist: print('s =', s) # Look at the output ``` ## 关联来源 - [[summaries/05_Lists]]