QuestionQ78

VerifiedMiscellaneous (List Comprehensions, Lambdas, Closures, I/O)

What behavior is expected from the following code?

Question Image

Explanation

range(5, 0, -1) produces the values 5 through 1 in descending order. Filtering those values for even numbers preserves their list order, producing [4, 2].

Community Discussion

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