GIAC
GPYC · Question #56
Which of the following is the output when the following program is executed with a Python Interpreter? ``python >>> a = -10 >>> if a: ... print(a) ... else: ... print(-a) ``
Sign in or unlock GPYC to reveal the answer and full explanation for question #56. The question stem and answer options stay visible for context.
Python Fundamentals & Command Line Tools
Question
Which of the following is the output when the following program is executed with a Python Interpreter?
>>> a = -10
>>> if a:
... print(a)
... else:
... print(-a)
Options
- Aa
- B10
- C-10
- D-a
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
#truthiness#negative integers#boolean evaluation#conditionals