C-18-Q044mediumsingle_mcq
To convert the same task to a for loop, an equivalent header is:
To convert the same task to a for loop, an equivalent header is:
- a
for i in range(0) - b
for i in range(1, 4) - c
for i in range(3, 1) - d
for i in range(-1, 3)
ব্যাখ্যা
range(1, 4) generates the values 1, 2, 3 — stopping before the upper bound 4 — which exactly matches the counter values entering the while (count<=3) loop. The stop value in range is always exclusive.