5.2 Understanding the loops
Given the following loop:
word = 'oxygen'
for char in word:
print(char)
How many times is the body of the loop executed?
- 3 times
- 4 times
- 5 times
- 6 times
Solution
The body of the loop is executed 6 times.
Episode 5 exercise 3