QuestionQ4

VerifiedFunctions and Exceptions

What is the output of this snippet?

Question Image

Explanation

The expression x + 1 passes 3 to fun. The function increments its local parameter by 1, returns 4, and that returned value is assigned to x; therefore, print(x) outputs 4.

Community Discussion

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