QuestionQ138

VerifiedControl Flow – Conditional Blocks and Loops

What is the output of this snippet?

Question Image

Explanation

list.insert(0, v) inserts each iterated value at the beginning of the list. Each later value therefore precedes the earlier ones, producing [3, 2, 1].

Community Discussion

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