GIAC
GPYC · Question #71
When the following program "question.py" is executed with Python what is the output? $ cat question.py def i(i): i=i return i i=i(10) print(i) $ python question.py
The correct answer is B. 5. You've hit your limit · resets 1pm (America/New_York)
Python Fundamentals & Command Line Tools
Question
When the following program "question.py" is executed with Python what is the output?
$ cat question.py
def i(i):
i=i
return i
i=i(10)
print(i)
$ python question.py
Options
- A10
- B5
- CFunctionOverride: function i assigned not called
- DFunction i at 0xb7489764
How the community answered
(32 responses)- A9% (3)
- B72% (23)
- C3% (1)
- D16% (5)
Explanation
You've hit your limit · resets 1pm (America/New_York)
Topics
#function definitions#variable shadowing#name binding#Python execution
Community Discussion
No community discussion yet for this question.