C-18-Q054mediumsingle_mcq
To sum the first 100 positive integers using a for loop instead, an equivalent header is:
To sum the first 100 positive integers using a for loop instead, an equivalent header is:
- a
for count in range(1, 100) - b
for count in range(1, 101) - c
for count in range(0, 100) - d
for count in range(100, 1)
ব্যাখ্যা
range(1, 101) produces the integers 1 through 100 since the stop value 101 is excluded. This exactly covers the first 100 positive integers needed for the sum.