A cool alternative

Code
Diff
  • def fizz_buzz(n):
        return (not(n % 3))*"Fizz" + (not(n % 5))*"Buzz" if not(n % 3) or not(n % 5) else str(n)
    
  • 11
    def fizz_buzz(n):
    
    2
        return "FizzBuzz" if n % 15 == 0 else "Fizz" if n % 3 == 0 else "Buzz" if n % 5 == 0 else str(n)
    
    2+
        return (not(n % 3))*"Fizz" + (not(n % 5))*"Buzz" if not(n % 3) or not(n % 5) else str(n)