nerdexam
Python_Institute

PCEP-30-02 · Question #213

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

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

Question

def func(x):
 global y
 y = x * x
 return y

func(2)
print(y)
What is the expected output of the following code?

Options

  • A2
  • BNone
  • CThe code is erroneous.
  • D4

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice