🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Conditions: all 13 questions

Quiz: Python Conditions · Question 8 of 13

What does this print? (code)

What does this print?

n = 15
if n % 3 == 0:
    print("A", end="")
if n % 5 == 0:
    print("B", end="")
  1. A.A
  2. B.B
  3. C.AB
  4. D.Nothing
Answer & explanation

Correct answer: AB

Two separate ifs: both are checked.

Can you get the rest right without peeking?

Take the timed Quiz: Python Conditions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →