using python
Given a number n, for each integer i in the range
from
1 to n inclusive, print one value per line as follows:
ALL
1
1
ºf is a multiple of both 3 and 5 print FizzBUZZ.
• If is a multiple of 3 (but not 5), print Fizz.
if is a multiple of $ (but not 3), print Buzz.
if is not a multiple of 3 or 5. print the value of .
1
20
2
Function Description
Complete the function fizzBuzz in the editor below.
fizzBuzz has the following parameter(s);
Answers
Answered by
9
def my_func(n):
for num in range(1,n+1):
if num%3==0:
print("fizz")
elif num%5==0:
print("Buzz")
elif num%3==0 and num%5==0:
print("fizzBuzz")
else:
print(num)
my_func(any number)
Similar questions