nerdexam
GIAC

GPYC · Question #53

What will be printed when the code in the screen capture is run? ``python >>> x=1 >>> y=2 >>> if x() and (y): ... z=x+y ... print(z) ... elif x() or (y): ... z=y-x ... print(z) ... else: ... z=z-y ...

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

Python Fundamentals & Command Line Tools

Question

What will be printed when the code in the screen capture is run?
>>> x=1
>>> y=2
>>> if x() and (y):
... z=x+y
... print(z)
... elif x() or (y):
... z=y-x
... print(z)
... else:
... z=z-y
... print(z)
... else:
... z=z-y
... print(z)

Options

  • AAn Error
  • B-1
  • C1
  • D2
  • E3

How the community answered

(26 responses)
  • A
    8% (2)
  • C
    4% (1)
  • D
    73% (19)
  • E
    15% (4)

Explanation

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

Topics

#TypeError#callable#conditionals#control flow

Community Discussion

No community discussion yet for this question.

Full GPYC Practice