This is a nice and simple function that can be followed fairly easily. The number, Fizz if it is divisible by 3, Buzz if it is divisible by 5 and This is a python function which, given a limit, will print numbers under the limit with the required replacements.įor the each number in 1 - limit inclusivly, this function prints either It is fairly trivial to make a program to print lists like this out and can be done with some basic programming skill. In the classic example you replace any number which is divisible by 3 with Fizz and any number divisible by 5 with Buzz, and any number which is divisible by both with FizzBuzz. The principle of FizzBuzz is a counting and substitution game you count to a limit and replace some numbers with words. FizzBuzz is variously a drinking game, a maths game, a way of learning numbers in a foreign language and more importantly (for this blog) a programming kata.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |