Skip to content
Snippets Groups Projects
Commit 8434d069 authored by Ortega Lalmolda, Juan Antonio's avatar Ortega Lalmolda, Juan Antonio
Browse files

Implementación FizzBuzz

parent 8299c268
Branches
No related tags found
No related merge requests found
Pipeline #30220 passed
...@@ -5,5 +5,12 @@ def fizzbuzz(n:int) -> str: ...@@ -5,5 +5,12 @@ def fizzbuzz(n:int) -> str:
And for the multiples of five print "Buzz". And for the multiples of five print "Buzz".
For numbers which are multiples of both three and five print "FizzBuzz". 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment