Beginner·7 min·basics · control flow
If / Else & Loops
Control Flow
Indentation matters in Python. Code inside an if or a for is indented (4 spaces).
Pieces
if / elif / else— choose a pathfor x in range(a, b)— iterateaup to but not includingb%— the modulo operator (remainder of division)
Try it
- Extend FizzBuzz to 30.
- Add a "Bazz" for multiples of 7.