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

The correct answer is C. -10. You've hit your limit · resets 1pm (America/New_York)

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

How the community answered

(51 responses)
  • A
    6% (3)
  • B
    2% (1)
  • C
    90% (46)
  • D
    2% (1)

Explanation

You've hit your limit · resets 1pm (America/New_York)

Topics

#truthiness#negative integers#boolean evaluation#conditionals

Community Discussion

No community discussion yet for this question.

Full GPYC Practice