Question: Write a function called fizz_buzz that takes a integer named N as a parameter. No error checking needed. If the number N is divisible by

Write a function called fizz_buzz that takes a integer named N as a parameter. No error checking needed. If the number N is divisible by 3, it should return "Fizz". If N is divisible by 5, it should return "Buzz" If N is divisible by both 3 and 5, it should return "FizzBuzz". Otherwise, it should return N. Hint: the order that you do the operations matters and the correct order may not be the same as listed above. Note: You should only write the function. Do not put any code outside of the function. Examples: fizz_buzz (6) 'Fizz' fizz_buzz (10) 'Buzz' fizz_buzz (15) 'FizzBuzz' fizz_buzz (4) 4 1 Full Screen code.py # New 1 #WRITE YOUR FUNCTION HERE. 2 #DO NOT WRITE ANYTHING OUTSIDE OF THE FUNCTION DEFINITION 3 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
