nerdexam
GIAC

GPYC · Question #50

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 ``

Sign in or unlock GPYC to reveal the answer and full explanation for question #50. The question stem and answer options stay visible for context.

Python Fundamentals & Command Line Tools

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

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

#NameError#undefined variable#Python errors#script execution
Full GPYC Practice