QuestionQ13

VerifiedControl Flow – Conditional Blocks and Loops

Arrange the code boxes in the correct order to create a loop whose counter variable takes the values 1, 3, and 5, in that order.

Drag & Drop
     
Explanation

Python’s range(start, stop, step) excludes the stop value. Thus, range(1, 7, 2) starts at 1 and increments by 2, producing 1, 3, and 5.

Community Discussion

No comments yet. Be the first to start the discussion!