|FizzBuzz
All Challenges

FizzBuzz

EasyLogic

Given an integer n, return a string based on these rules:


- If n is divisible by 3, return "Fizz"

- If n is divisible by 5, return "Buzz"

- If n is divisible by both 3 and 5, return "FizzBuzz"

- Otherwise, return n as a string


Every developer has written this at least once. Write it clean.

Examples

Input: fizzbuzz(3)
Output: "Fizz"
3 is divisible by 3
Input: fizzbuzz(5)
Output: "Buzz"
5 is divisible by 5
Input: fizzbuzz(15)
Output: "FizzBuzz"
15 is divisible by 3 and 5
Input: fizzbuzz(7)
Output: "7"
No match — return n as string

Constraints

  • 1 <= n <= 10,000
pythoneditor
Loading Python runtime…