QuestionQ144

VerifiedControl Flow – Conditional Blocks and Loops

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

Drag & Drop
     
Explanation

range(5, 0, -2) starts at 5, decreases by 2 each iteration, and excludes its stop value of 0; it therefore produces 5, 3, and 1.

Community Discussion

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