QuestionQ189

VerifiedFunctions and Exceptions

What is the expected output from this code?

Question Image

Explanation

Assigning num = 3 inside the function creates a local variable, which does not change the global num = 1. The function prints 3, and the final statement prints the unchanged global value, 1.

Community Discussion

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