nerdexam
Python_Institute

PCAP-31-03 · Question #33

What is the expected output of the following code? def foo(x,y,z): return x(y) - x(z) print{f00(lambda x: x % 2, 2, 1) )

The correct answer is C. -1. See the full explanation below for the reasoning.

Question

What is the expected output of the following code? def foo(x,y,z):

return x(y) - x(z) print{f00(lambda x: x % 2, 2, 1) )

Options

  • A1
  • B0
  • C-1
  • Dan exception is raised

How the community answered

(43 responses)
  • A
    12% (5)
  • B
    2% (1)
  • C
    79% (34)
  • D
    7% (3)

Community Discussion

No community discussion yet for this question.

Full PCAP-31-03 Practice