QuestionQ28

VerifiedPython Basics for Data Analysis

What is the output of the following code?

Question Image

Explanation

A global x declaration makes the assignment inside the function update the module-level variable. The function returns 5, and the global x is also 5 when print evaluates its second argument.

Community Discussion

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