Created
October 27, 2013 20:49
-
-
Save oyvindrobertsen/7187715 to your computer and use it in GitHub Desktop.
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
def fizzBuzz(n): | |
pos = [["FizzBuzz", "Fizz"], ["Fizz", ""]] | |
for i in range(n): | |
a = int(math.ceil((i%3) / float(n))) | |
b = int(math.ceil((i%5) / float(n))) | |
print i , ": " , pos[a][b] | |
fizzBuzz(100) |
mathiasose
commented
Oct 27, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment