Question: Write a Python program that outputs the numbers from 1 to 100. However, if the number is divisible by 3, it should output Fizz instead.

Write a Python program that outputs the numbers from 1 to 100. However, if the number is divisible by 3, it should output Fizz instead. If the number is divisible by 5, it should output Buzz instead. If the number is divisible by both 3 and 5, output Fizzbuzz. An example output for the first 36 numbers would be: 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!