Project Requirements: Build FizzBuzz in Python
We've come to our first exercise that you are going to build out in this section of the course. What we're going to build out is something that combines all of the different knowledge that you learned up to this point and the project that we're going to implement is one of the more popular coding interview questions out there, which is called the fizz buzz exercise.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

What we're going to do is outlined right here.

large

So we're going to write a program that prints the numbers from 1 to 100 but for multiples of 3 it prints Fizz. So it prints a string of fizz instead of the number and for the multiples of five it prints Buzz for the numbers which are multiples of both 5 and 3 then you're going to print out fizz buzz. And so just to give an idea of what this is going to look like you're going to print out something that is 1, 2, 3, 4, and 5. But instead of where we have a number 3 right here, this instead is going to be the string Fizz and instead of the number 5 this is going to be Buzz.

1
2
Fizz
4
Buzz

Then if we continue this down the line until we get to 15 then this is going to be FizzBuzz. Just like we have right there and it doesn't stop at 15, I want you to print out the numbers from 1 to 100. For extra credit for the function that you're going to build and you can call the function FizzBuzz, I want you to be able to pass in an arbitrary max of value.

In other words, even though I said to have 1 to 100 I want the function to be able to take any kind of maximum number. So you could pass in 20 and they'll print out 1 to 20 following the same rules outlined above. Or you could pass in 1000 and you'll print out 1 to 1000 while still following all of the same rules.

So nothing in this is going to be hardcoded. Instead you are going to implement pretty much every kind of system that we've worked on so far. So you're going to build out a function you are going to work with looping. Then you're going to work with multiple conditionals and then you're going to be working with mathematical operators in order to get all of this working, so you need to include each one of these four components in order to successfully complete the exercise.

Once you're done submit it to your instructor for approval and then continue moving on in the course.