Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Fizz Buzz

Write a program that prints the numbers within a range start to end, or alternatively returns the values in a list. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

The number 33 would be 'Fizz', the number 30 (3 x 5 x 2) would be 'Fizzbuzz'.

fizzbuzz( 10, 18 ) # > "Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz"
# Alternatively
fizzbuzz( 4, 10 ) # > [4, 'Buzz', 6, 7, 8, 'Fizz', 'Buzz']