Created
March 26, 2022 08:02
-
-
Save massenz/9c79da4a38b8715549585b8ff723b373 to your computer and use it in GitHub Desktop.
FizzBuzz in less than 5 minutes, as described at http://codetrips.com
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 python | |
# | |
# FizzBuzz -- created by M. Massenzio, 2022-03-26 | |
import sys | |
n = sys.argv[1] | |
for i in range(3, int(n) + 1): | |
out = "" | |
if i % 3 == 0: | |
out = "Fizz" | |
if i % 5 == 0: | |
out += "Buzz" | |
if out != "": | |
print(f"{i}: {out}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment