--- id: 696655d24b614176d4c9b78c title: "Challenge 169: FizzBuzz Mini" challengeType: 29 dashedName: challenge-169 --- # --description-- Given an integer, return a string based on the following rules: - If the number is divisible by 3, return `"Fizz"`. - If the number is divisible by 5, return `"Buzz"`. - If the number is divisible by both 3 and 5, return `"FizzBuzz"`. - Otherwise, return the given number as a string. # --hints-- `fizz_buzz_mini(3)` should return `"Fizz"`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertEqual(fizz_buzz_mini(3), "Fizz")`) }}) ``` `fizz_buzz_mini(4)` should return `"4"`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertEqual(fizz_buzz_mini(4), "4")`) }}) ``` `fizz_buzz_mini(35)` should return `"Buzz"`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertEqual(fizz_buzz_mini(35), "Buzz")`) }}) ``` `fizz_buzz_mini(75)` should return `"FizzBuzz"`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertEqual(fizz_buzz_mini(75), "FizzBuzz")`) }}) ``` `fizz_buzz_mini(98)` should return `"98"`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertEqual(fizz_buzz_mini(98), "98")`) }}) ``` # --seed-- ## --seed-contents-- ```py def fizz_buzz_mini(n): return n ``` # --solutions-- ```py def fizz_buzz_mini(n): if n % 3 == 0 and n % 5 == 0: return "FizzBuzz" if n % 3 == 0: return "Fizz" if n % 5 == 0: return "Buzz" return str(n) ```