Here you have in Python
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (division, absolute_import, print_function, unicode_literals) class FizzBuzz: def __init__(self): self.fizzbuzz = dict() for num in range(3, 101, 3): self.fizzbuzz[num] = "Fizz" for num in range(5, 101, 5): self.fizzbuzz[num] = "Buzz" for num in range(15, 101, 15): self.fizzbuzz[num] = "FizzBuzz" self.run() def run(self): for number in range(1, 101): print(self.fizzbuzz.get(number, number)) def main(): FizzBuzz() if __name__ == '__main__': main()
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here you have in Python