C-17-Q088mediumsingle_mcq
With range(1, 6, -1), the loop body in Python:
With range(1, 6, -1), the loop body in Python:
- aRuns five times
- bDoes not execute (empty range)
- cCounts down from 6 to 1
- dRaises a syntax error
ব্যাখ্যা
With a positive start (1) less than the stop (6) but a negative step (), range produces no values at all. The sequence is empty, so the loop body never runs and Python raises no error.