Created
February 16, 2022 13:40
-
-
Save xaldoxxx/1ad293abf148a822eed1c975597c10d2 to your computer and use it in GitHub Desktop.
ejeciccio codewars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def FizzBuzz(num): | |
''' | |
FizzBuzz | |
<num> is an integer | |
Prints out FizzBuzz if <num> is divisible by 3 and 5 | |
''' | |
if num % 3 == 0 and num % 5 == 0: | |
return "FizzBuzz" | |
elif num % 3 == 0: | |
return "Fizz" | |
elif num % 5 == 0: | |
return "Buzz" | |
else: | |
return num | |
if __name__ == "__main__": | |
for i in range(1,101): | |
print(FizzBuzz(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment