nerdexam
Python_Institute

PCEP-30-02 · Question #307

How many stars () will the following code output to the screen? n = 1 if n == 1: print("") if n == True: print("") if n == False: print("*")

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

Question

How many stars () will the following code output to the screen? n = 1 if n == 1: print("") if n == True: print("") if n == False: print("*")

Options

  • Aone
  • Btwo
  • Ctwo

How the community answered

(27 responses)
  • A
    11% (3)
  • B
    7% (2)
  • C
    81% (22)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice