nerdexam
Python_Institute

PCEP-30-02 · Question #303

How many stars will the following snippet send to the console? i = 2 while i >= 0: print("*") i -= 2

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

Question

How many stars will the following snippet send to the console? i = 2 while i >= 0: print("*") i -= 2

Options

  • Athree
  • Btwo
  • Cone

How the community answered

(52 responses)
  • A
    8% (4)
  • B
    77% (40)
  • C
    15% (8)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice