nerdexam
Python_Institute

PCEP-30-02 · Question #113

What is the expected output of the following code? ``python x = True y = False z = False if x or y and z: print('TRUE') else: print('FALSE') ``

The correct answer is B. TRUE. See the full explanation below for the reasoning.

Question

What is the expected output of the following code?
x = True
y = False
z = False

if x or y and z:
 print('TRUE')
else:
 print('FALSE')

Options

  • AThe code is erroneous.
  • BTRUE
  • CFALSE
  • DNone of the above.

How the community answered

(52 responses)
  • A
    13% (7)
  • B
    75% (39)
  • C
    8% (4)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice