From b61fea700aafca89cd76d8b891fba0b6eed46a85 Mon Sep 17 00:00:00 2001 From: Harsh Vartak <50980498+Harshvartak@users.noreply.github.com> Date: Mon, 5 Oct 2020 00:57:27 +0530 Subject: [PATCH] Create 0412_Fizz Buzz.py --- LeetCode/0412_Fizz Buzz.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 LeetCode/0412_Fizz Buzz.py diff --git a/LeetCode/0412_Fizz Buzz.py b/LeetCode/0412_Fizz Buzz.py new file mode 100644 index 0000000..fe6d00b --- /dev/null +++ b/LeetCode/0412_Fizz Buzz.py @@ -0,0 +1,4 @@ +class Solution(object): + def fizzBuzz(self, n): + return [str(i) * (i % 3 != 0 and i % 5 != 0) + "Fizz" * (i % 3 == 0) + "Buzz" * (i % 5 == 0) + for i in range(1, n + 1)]