nerdexam
Python_Institute

PCEP-30-02 · Question #326

How many stars will the following snippet print to the monitor? x = 16 while x > 0: print('**') x //= 2

The correct answer is D. five. See the full explanation below for the reasoning.

Question

How many stars will the following snippet print to the monitor? x = 16 while x > 0: print('**') x //= 2

Options

  • Athree
  • Bone
  • CThe code will enter an infinite loop.
  • Dfive

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    4% (1)
  • C
    15% (4)
  • D
    78% (21)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice