From a54088220c2e9c0e00b2c46d8a8e3949f9037a98 Mon Sep 17 00:00:00 2001 From: Fernando Gomez <fernando.gomezu@tecnalia.com> Date: Thu, 16 Jul 2020 11:58:37 +0200 Subject: [PATCH] first try --- fizzbuzz.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fizzbuzz.py b/fizzbuzz.py index 8f45358..62662d9 100644 --- a/fizzbuzz.py +++ b/fizzbuzz.py @@ -5,5 +5,14 @@ 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 "" + l = [] + for i in range(100): + if i % 2 == 0: + l.append ("Fizz") + elif i % 3 == 0: + l.append ("Buzz") + else: + l.append(str(i)) + + return l -- GitLab