Last active
April 28, 2021 22:35
-
-
Save sophiezhng/1bdf142da57751208be470c6c3394e40 to your computer and use it in GitHub Desktop.
Fizz Buzz Python Solution
This file contains hidden or 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 main(): | |
fizz_buzz(100) | |
return | |
def fizz_buzz(n): | |
for i in range(1,n+1): | |
output = "" | |
if i % 3 == 0: | |
output += "Fizz" | |
if i % 5 == 0: | |
output += "Buzz" | |
if output == "": | |
output += str(i) | |
print(output) | |
return 0; | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment