Be certain that your conditions are checked organized appropriately.
A Fizzbuzz number is likewise a Fizz (divisible by 3) and a Buzz (divisible by 5), just all things considered. In the code, you composed on the off chance that you inquire as to whether 15 is a Buzz since it is the first check, you will get a positive outcome.
The condition you need to test here isn't if a number is divisible by 15 yet in the event that a number is divisible by 3 and 5 simultaneously.
Given this clarification you need to compose conditions a piece in an unexpected way:
a=int(input('Enter a number: '))
def fizzbuzz(a):
if a % 3 == 0 and a % 5 == 0:
return('Fizzbuzz')
elif a % 3 == 0:
return('Fizz')
elif a % 5 == 0:
return('Buzz')
else:
return a
print(fizzbuzz(a))
Interested to learn python in detail? Come and Join the python course.
Watch this video tutorial on how to become a professional in python