Question
The first program simulates the word game fizzBuzz . The task is to create a function fizzBuzz that takes in three arguments - N (the
The first program simulates the word game fizzBuzz. The task is to create a function fizzBuzz that takes in three arguments - N (the number we are going to count upto), divisor_1 (the first divisor) and divisor_2 ( the second divisor). The function would check if all numbers starting from 1 to N are divisible by both the divisors. The function returns no value. For your output-
1. If the number is divisible the divisor_1 print Fizz.
2. If the number is divisible by the divisor_2 print Buzz
3. If the number is divisible by both the first and the second divisor, print FizzBuzz
4. For everything else, print the number itself.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started