Sail E0 Webinar
Question
What is the output of the following?i = 2while True:    if i%3 == 0:        break    print(i)    i += 2
Options:
A .  2 4 6 8 10 "¦
B .  2 4
C .  2 3
D .  error
Answer: Option B


The numbers 2 and 4 are printed. The next value of i is 6 which is divisible by 3 and hence control exits the loop.



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers