C-18-Q099mediumsingle_mcq
Which Python program correctly displays NCTB three times using a while loop?
Which Python program correctly displays NCTB three times using a while loop?
- a
count=1thenwhile count<=3: print('NCTB'); count=count+1 - b
count=0thenwhile count==3: print('NCTB') - c
count=3thenwhile count<0: print('NCTB') - d
print('NCTB' * 0)
ব্যাখ্যা
Option (a) correctly initializes count=1, loops while count<=3, and increments count each pass, printing NCTB exactly three times. The others either never enter the loop or loop forever because their conditions or updates are wrong.