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

Quiz: Python Interview Programs · Question 10 of 13

What does this print? (code)

What does this print?

for i in range(9, 16):
    if i % 15 == 0:
        print("FizzBuzz", end=" ")
    elif i % 3 == 0:
        print("Fizz", end=" ")
    elif i % 5 == 0:
        print("Buzz", end=" ")
  1. A.Fizz Buzz Fizz Fizz
  2. B.Fizz Buzz Fizz FizzBuzz Fizz
  3. C.Fizz Buzz Fizz Fizz FizzBuzz
  4. D.Fizz Buzz Fizz FizzBuzz
Answer & explanation

Correct answer: Fizz Buzz Fizz FizzBuzz

9 Fizz, 10 Buzz, 12 Fizz, 15 FizzBuzz; 11, 13 and 14 print nothing here.

Can you get the rest right without peeking?

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

Start the quiz →