Logic Building
# Print odd numbers from 1 to 100
for i in range(1, 101, 2):
print(i)Output
1 3 5 7 9 ... 99
Use range with step 2 starting from 1.
Key Concepts:
- range(1, 101, 2) gives: 1, 3, 5, 7, ..., 99
- Step size 2 skips even numbers
- All are odd numbers