QuestionQ46

VerifiedControl Flow – Conditional Blocks and Loops

What is the expected output of this code?

Question Image

Explanation

range(4) produces the integers 0, 1, 2, and 3. Each value is appended to x, so the function returns and prints [0, 1, 2, 3].

Community Discussion

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