nerdexam
Python_Institute

PCEP-30-02 · Question #322

How many stars ('') will the following code output to the screen? n = 0 if n > 0: print("") elif n == True: print("") else: print("****")

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

Question

How many stars ('*') will the following code output to the screen? n = 0 if n > 0: print("") elif n == True: print("") else: print("***")

Options

  • Aone
  • Bsix
  • Ctwo
  • Dthree

How the community answered

(60 responses)
  • A
    3% (2)
  • B
    8% (5)
  • C
    15% (9)
  • D
    73% (44)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice