nerdexam
Python_Institute

PCEP-30-02 · Question #290

How many stars will the following code print to the monitor? ``python 1 i = 0 2 while i <= 3: 3 print('*') 4 i += 2 ``

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

Question

How many stars will the following code print to the monitor?
1 i = 0
2 while i <= 3:
3 print('*')
4 i += 2

Options

  • Aone
  • Bthree
  • Ctwo
  • Dzero

How the community answered

(49 responses)
  • A
    10% (5)
  • B
    2% (1)
  • C
    84% (41)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice