nerdexam
Python_Institute

PCEP-30-02 · Question #188

PCEP-30-02 Question #188: Real Exam Question with Answer & Explanation

The correct answer is D. The code is erroneous.. See the full explanation below for the reasoning.

Question

What is the expected output of the following code? def func(x): if x % 2 == 0: return 1 else: return print(func(func(2)) + 1)

Options

  • ANone
  • B1
  • C2
  • DThe code is erroneous.

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice