nerdexam
GIAC

GPYC · Question #20

What willt the code in the screen capture print when executed? ``python >>> x=4 >>> y=0 >>> if(y): ... x=x+2 ... print(x) ... else: ... x=x-2 ... print(x) ``

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

Python Fundamentals & Command Line Tools

Question

What willt the code in the screen capture print when executed?
>>> x=4
>>> y=0
>>> if(y):
... x=x+2
... print(x)
... else:
... x=x-2
... print(x)

Options

  • A2
  • B4
  • Cx
  • DAn error
  • E6

How the community answered

(41 responses)
  • A
    90% (37)
  • B
    5% (2)
  • D
    2% (1)
  • E
    2% (1)

Explanation

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

Topics

#boolean truthiness#falsy values#conditional statements#if/else

Community Discussion

No community discussion yet for this question.

Full GPYC Practice