Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
switch-case solution in Uncategorized category for Fizz Buzz by bryukh
def checkio(number):
"""
Python switch-case
"""
fizz_buzz = bool(number % 3), bool(number % 5)
return {(False, False): "Fizz Buzz",
(False, True): "Fizz",
(True, False): "Buzz",
(True, True): str(number)}[fizz_buzz]
Feb. 20, 2014
Comments: