Skip to content

Instantly share code, notes, and snippets.

@massenz
Created Mar 26, 2022
Embed
What would you like to do?
FizzBuzz in less than 5 minutes, as described at http://codetrips.com
#!/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