Created
November 29, 2017 10:23
-
-
Save wido/e5b51d4f2c15d6034630da79425ad73a to your computer and use it in GitHub Desktop.
FizzBuzz in Python 3
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
#!/usr/bin/env python3 | |
for i in range(1, 100 + 1): | |
buf = str() | |
if (i % 3) == 0: | |
buf += "Fizz" | |
if (i % 5) == 0: | |
buf += "Buzz" | |
if not buf: | |
buf = i | |
print(buf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment