Write the expected output
For a loop that should display 1 through 5, write the five numbers down first. Then run a loop using for i in range(5): print(i) and note the actual output: 0 through 4.
Trace each loop iteration
range(5) starts at zero and stops before five. To start at one and include five, use range(1, 6). Read the first and last values before running the revised loop.
Check the boundary cases
Test a one-item range such as range(1, 2) and an empty range such as range(1, 1). If you need help, share the shortest reproducible example, expected output and actual output without account credentials or API keys.
