C-17-Q129mediumsingle_mcq
In the program for i in range(1, 101): if (i % 2 != 0): print(i), removing the inner if would print:
In the program for i in range(1, 101): if (i % 2 != 0): print(i), removing the inner if would print:
- aOnly even numbers
- bOnly odd numbers
- cAll numbers from 1 to 100
- dNothing at all
ব্যাখ্যা
The if (i % 2 != 0) filters output to odd numbers only. Without it, the bare for loop over range(1, 101) prints every value, i.e. all numbers from 1 to 100.