Counting Down
Loop backwards.
Counting Down 📉
Time for a countdown! 5, 4, 3, 2, 1... blast off! 🚀 We use a NEGATIVE step.
Negative Step ⬇️
A step of -1 makes range count backwards!
for i in range(5, 0, -1):
print(i)All lessons in this course
- The range Helper
- Counting Up
- Counting by Steps
- Counting Down