Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check(i:int):
- if i == 0:
- return str(i)
- if (abs(i)) % 15 == 0:
- return "fizzbuz"
- if (abs(i)) % 3 == 0:
- return "fizz"
- if (abs(i)) % 5 == 0:
- return "buzz"
- return str(i)
- def main():
- for i in range(0, 31):
- print(check(i))
- if __name__ == '__main__': #triggered by call from terminal
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement