Home » Programming Language (coding) » Python MCQ » Study the following program: i = 1: while True: if i%3 == 0: break print(i) Which of the following is the correct output of this program?

Study the following program: i = 1: while True: if i%3 == 0: break print(i) Which of the following is the correct output of this program?

Study the following program:

i = 1:
while True:
    if i%3 == 0:
        break
    print(i) 

Which of the following is the correct output of this program?

A. 1 2 3
B. 3 2 1
C. 1 2
D. Invalid syntax

Correct Answer: Option D. Invalid syntax 

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve : *
30 ⁄ 3 =