nerdexam
Python_Institute

PCEP-30-02 · Question #306

How many stars will the following code send to the monitor? x = 0 while x < 6: x += 1 if x % 2 == 0: continue print('*')

The correct answer is C. three. See the full explanation below for the reasoning.

Question

How many stars will the following code send to the monitor? x = 0 while x < 6: x += 1 if x % 2 == 0: continue print('*')

Options

  • Aone
  • Btwo
  • Cthree
  • Dzero

How the community answered

(20 responses)
  • A
    5% (1)
  • B
    5% (1)
  • C
    80% (16)
  • D
    10% (2)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice