Chapter 17: Problem 1
What is the output of the following code, and why? \(\gg>>X=\) 'Spam' \(\gg \gg\) def func(): \(\operatorname{print}(X)\) \(\gg>\) func()
Short Answer
Expert verified
The output is 'Spam' because X is a global variable with the value 'Spam'.
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.