Created
November 12, 2023 10:58
-
-
Save micedreams/a3467b39aa46c0caa3089914af0019e9 to your computer and use it in GitHub Desktop.
python fizbuzz
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 fizz_buzz(n): | |
if n % 10 == 0 : | |
return "FizzBuzz" | |
elif n % 5 == 0: | |
return "Buzz" | |
elif n % 2 == 0: | |
return "Fizz" | |
else: | |
return n | |
for i in range(1, 20): | |
print(fizz_buzz(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment