QuestionQ11

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

What is the expected output of this code?

Question Image

  • A an exception is raised
  • B 1
  • C 0
  • D -1
Explanation

The lambda evaluates 2 % 2 as 0 and 1 % 2 as 1. The function subtracts these values, producing 0 - 1, or -1.

Community Discussion

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