GIAC
GPYC · Question #50
GPYC Question #50: Real Exam Question with Answer & Explanation
The correct answer is B. NameError: name 'c' is not defined. See the full explanation below for the reasoning.
Question
Which of the following is in the output when program1.py shown below is executed?
$ cat program1.py
a = 5
b = 10
d = a + c
print(d)
$ python program1.py
Options
- ATypeError: cannot concatenate 'str' and 'int' objects
- BNameError: name 'c' is not defined
- Cac
- D15
Community Discussion
No community discussion yet for this question.