The key insight: check "divisible by both" first. Why?
If you check "divisible by " first, numbers like would print "Fizz" and skip the FizzBuzz case.
# Wrong order
if n % 3 == 0:
print("Fizz") # 15 matches here
elif n % 5 == 0:
print("Buzz")
elif n % 3 == 0 and n % 5 == 0:
print("FizzBuzz") # Never reached!
Check the most specific condition (divisible by both) before the more general conditions.