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
Sign in or unlock GPYC to reveal the answer and full explanation for question #71. The question stem and answer options stay visible for context.
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
Unlock GPYC to see the answer
You've previewed enough free GPYC questions. Unlock GPYC for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#function definitions#variable shadowing#name binding#Python execution