Home » Programming Language (coding) » Python MCQ » Study the following program: a = 1 while True: if a%7 == 0: break print(a) a += 1

Study the following program: a = 1 while True: if a%7 == 0: break print(a) a += 1

Study the following program:

a = 1
while True:
    if a%7 == 0:
        break
    print(a)
    a += 1 

Which of the following is correct output of this program?

A. 12345
B. 123456
C. 1234567
D. Invalid syntax

Correct Answer: Option B. 1 2 3 4 5 6 

Leave a Reply

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

Solve : *
8 − 7 =