Q. What is the output of while i < 3: print(i); i += 1 with i = 0?

A
0 1 2
B
0 1 2 3
C
1 2 3
D
Error
Solution:

The while loop prints 0, 1, 2 as i increments from 0 to 2.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!