Track 4 · Lesson 2 of 11
range() in depth: start, stop and step
Control exactly which numbers a for loop visits with range(start, stop, step), count down, and avoid off-by-one errors.
You will be able to
- Use range(start, stop) to count from any starting number
- Use a step to skip values or count backwards
- Explain why the stop value is never included
- Spot and fix off-by-one errors in loops
Included with a Formula Quest membership
It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.
View Formula Quest memberships
Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.