Skip to content

Instantly share code, notes, and snippets.

@pcote
Created January 1, 2016 15:53
Show Gist options
  • Select an option

  • Save pcote/d6f22185edfb7dfbc64d to your computer and use it in GitHub Desktop.

Select an option

Save pcote/d6f22185edfb7dfbc64d to your computer and use it in GitHub Desktop.
def fizzbuzz1(max_num):
for num in range(1, max_num+1):
msg = ""
if num % 3 == 0:
msg += "fizz"
if num % 5 == 0:
msg += "buzz"
print("{}: {}".format(num, msg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment