Answered step by step
Verified Expert Solution
Link Copied!

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=""?

image text in transcribed

\# 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

How flying airoplane?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago