Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Captain Obvious solution in Clear category for Fizz Buzz by ale1ster
def checkio(number):
res = []
if not (number % 3):
res.append('Fizz')
if not (number % 5):
res.append('Buzz')
#The return value of a short-circuit operator like 'or',
#is the value of the last evaluated argument.
#And since the last evaluated argument of 'or' will be the true one,
# (empty strings are considered false) 'res' will have the proper value.
res = ' '.join(res) or str(number)
return res
May 17, 2014
Comments: