Created
March 7, 2017 04:12
-
-
Save Cr4ck3r/953dc537676465884398d797788d8b0a to your computer and use it in GitHub Desktop.
Fizzbuzz as an Importable Function
This file contains hidden or 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
| 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