Solved

What Happens When a Function Tries to Assign or Change

Question 36

Multiple Choice

What happens when a function tries to assign or change a value of a variable that has been defined at the module level?


A) The function succeeds, because the module variable is considered global in scope.
B) The function succeeds, but the value is appended to the variable.
C) The function fails, and an out of scope error message is raised.
D) Python creates a temporary variable with the same name, and the value of that variable exists only within the scope of the function.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents