QuestionQ246

VerifiedControl Flow – Conditional Blocks and Loops

Arrange the code boxes in the proper order to create a loop whose number variable takes the values –2, 0, and 2, in that order.

Drag & Drop
     
Explanation

range(-2, 3, 2) starts at -2, adds 2 each iteration, and stops before 3; it therefore yields -2, 0, and 2.

Community Discussion

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