QuestionQ183

VerifiedFunctions and Exceptions

What is the expected behavior of the following code snippet?

Question Image

It will:

Explanation

The function parameter x is local to a. The global x becomes 4 on Line 8, and calling a(4) returns 2 * 4, so the program prints 8.

Community Discussion

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