Counting by Steps
Skip numbers.
Counting by Steps 🪜
What if we want to skip numbers? range has a third number called the step! 🦘
Count by Twos 2️⃣
range(0, 10, 2) jumps by 2: 0, 2, 4, 6, 8!
for i in range(0, 10, 2):
print(i)All lessons in this course
- The range Helper
- Counting Up
- Counting by Steps
- Counting Down