Skip to content

Instantly share code, notes, and snippets.

@Cr4ck3r
Created March 7, 2017 04:12
Show Gist options
  • Save Cr4ck3r/953dc537676465884398d797788d8b0a to your computer and use it in GitHub Desktop.
Save Cr4ck3r/953dc537676465884398d797788d8b0a to your computer and use it in GitHub Desktop.
Fizzbuzz as an Importable Function
def fizzbuzz(a):
"""performs fizzbuzz process using a for loop"""
for n in range (1,a+1):
if n % 3 == 0 and n % 5 == 0:
print("FizzBuzz")
elif n % 3 == 0:
print ("Fizz")
elif n % 5 == 0:
print ("Buzz")
else:
print (n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment