Print Fizz Buzz for multiples of certain numbers

In this program, we will print Fizz Buzz and FizzBuzz for multiples of certain numbers.

Steps to solve the program
  1. Use for loop with the range function to iterate over all the numbers from 1 to 30.
  2. If a number is multiple of 3 and 5 then print FizzBuzz.
  3. If a number is multiple of 3 print Fizz.
  4. If a number is multiple of 5 print Buzz.
				
					#Printing output
for i in range(1,31):
    if i%3 == 0 and i%5 == 0:
        print("FizzBuzz")
    elif i%3 == 0:
        print("Fizz")
    elif i%5 == 0:
        print("Buzz")
				
			

Output :

				
					Fizz
Buzz
Fizz
Fizz
Buzz
Fizz
FizzBuzz
Fizz
Buzz
Fizz
Fizz
Buzz
Fizz
FizzBuzz
				
			

program to get the Fibonacci series

converts all uppercases in the word to lowercase

Leave a Comment