Skip to content
Snippets Groups Projects
Commit 8a0c7f71 authored by Fernando Gomez's avatar Fernando Gomez
Browse files

creo que ya esta

parent 21bf647d
Branches master
No related tags found
No related merge requests found
Pipeline #30235 passed
def fizzbuzz(n:int) -> str: def fizzbuzz(i:int) -> str:
""" """
Write a program that prints the numbers from 1 to 100. Write a program that prints the numbers from 1 to 100.
But for multiples of three print "Fizz" instead of the number But for multiples of three print "Fizz" instead of the number
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".
""" """
l = []
for i in range(1:100):
if i % 2 == 0: if i % 3 == 0 and i % 5 == 0:
l.append ("Fizz") s ="FizzBuzz"
elif i % 3 == 0: elif i % 3 == 0:
l.append ("Buzz") s = "Fizz"
elif i % 5 == 0:
s ="Buzz"
else: else:
l.append(str(i)) s = str(i)
return l return s
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment