Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am trying to solve the FizzBuzz problem where we print FizzBuzz if the integer is divisible by 3 and 5, Fizz if divisible by
I am trying to solve the FizzBuzz problem where we print FizzBuzz if the integer is divisible by 3 and 5, Fizz if divisible by 3 and Buzz if divisible by 5
I have the following code that I dont need help in understanding. Can someone walk me through the code? why do we only test for 3 and 5 separately and not if divisible by both 3 and 5? also what is c3 and c5? and what is d=""?
\# code c3=0 c5=0 d=" for i in range (1,101) : c3+=1 c5+=1 if (c3==3) : d+= "fizz" c3=0 if (c5==5) : d+= "buzz" c5=0 if (d==" " ) : print(i) else: d=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