From 8434d069a54980a2cfec63d59c88df55be82eb0d Mon Sep 17 00:00:00 2001 From: "Ortega Lalmolda, Juan Antonio" <jantonio.ortega@tecnalia.com> Date: Thu, 16 Jul 2020 12:01:38 +0200 Subject: [PATCH] =?UTF-8?q?Implementaci=C3=B3n=20FizzBuzz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fizzbuzz.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fizzbuzz.py b/fizzbuzz.py index 8f45358..07a8237 100644 --- a/fizzbuzz.py +++ b/fizzbuzz.py @@ -5,5 +5,12 @@ def fizzbuzz(n:int) -> str: And for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". """ - return "" + if n % 3 == 0 and n % 5 == 0: + return "FizzBuzz" + elif n % 3 == 0: + return "Fizz" + elif n % 5 == 0: + return "Buzz" + else: + return str(n) -- GitLab