Computer Science, asked by kritikayadav190305, 9 months ago

Write a python script that fetches a range from the user and prints “Fizz” if the number is multiple of 3 and prints “Buzz”, if the number is multiple of 5. It should print “FizzBuzz” if the number multiple of both 3 and 5 otherwise print “OOPS”. [4] Hint : if the range is given as 10 and 15 then following output should be shown : 10 Buzz 11 OOPS 12 Fizz 13 OOPS 14 OOPS 15 FizzBuzz

Answers

Answered by Kaushikkalesh
12

a, b = [int(i) for i in input().split()]

for i in range(a, b+1):

if i%3 == 0 and i%5 == 0:

print(f"{i} FizzBuzz",end = ' ')

elif i%3 == 0:

print(f"{i} Fizz", end = ' ')

elif i%5 == 0:

print(f"{i} Buzz", end = ' ')

else:

print(f"{i} OOPS", end = ' ')

Please Mark this as Brainliest

And Thank Me

Similar questions