Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- """
- configurable fizzbuzz in Python 2.6+ and Python 3
- 2014 Damian Yerrick, Creative Commons Zero
- """
- from __future__ import print_function, division
- import sys
- divs = [
- (3, "fizz"),
- (5, "buzz"),
- ]
- for n in range(1, 101):
- need_num = True
- for (divisor, symbol) in divs:
- if n % divisor == 0:
- print(symbol, end='')
- need_num = False
- if need_num:
- print("%d" % n, end='')
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement