PRACTICE / UNDERSTAND / REPEAT

Python: Control flow

Practice control flow with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

17 questionsAnswers explainedFree · no login
Question 1 of 17
Control flow · Code recallQuestion link ↗

Complete the loop so it visits each item in `names`.

for name ___ names:
    print(name)
Answer & explanation

Answer: in

`for name in names` iterates over the elements of the list.