Created
June 28, 2019 09:43
-
-
Save elliotdavies/8520c61878a74a31baa5fae842741432 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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