Home » Programming Language (coding) » Python MCQs » 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 

Take Part in Discussion:

Your email address will not be published.

Solve : *
20 + 25 =