Skip to content

Instantly share code, notes, and snippets.

@elliotdavies
Created June 28, 2019 09:43
Show Gist options
  • Save elliotdavies/8520c61878a74a31baa5fae842741432 to your computer and use it in GitHub Desktop.
Save elliotdavies/8520c61878a74a31baa5fae842741432 to your computer and use it in GitHub Desktop.
# FizzBuzz
Write a program that prints the numbers from 1 to 100, except:
- For multiples of 3, print "Fizz" instead of the number
- For multiples of 5, print "Buzz" instead of the number
- For multiples of both 3 and 5, print "FizzBuzz" instead of the number
## Extension
Modify your program so that it accepts a list of words and multiples as input. The input might look like this:
`[[3, 'Fizz'], [5, 'Buzz'], [7, 'Pop']]`
Note that the "FizzBuzz" behaviour for common multiples should still work correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment