Created
October 18, 2014 00:37
-
-
Save jkopczyn/8c07053e09e405dffce8 to your computer and use it in GitHub Desktop.
This Resembles FizzBuzz
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(): | |
x= raw_input("Max number for FizzBuzz/PingPong:") | |
fizz_ping_flag=1 | |
fizz = ["fizz","ping"] | |
buzz = ["buzz","pong"] | |
fizzbuzz = ["fizzbuzz", "ping-pong"] | |
for i in range(1,int(x)): | |
if i%3 and i%5: | |
print i | |
elif not(i%3) and i%5: | |
print fizz[fizz_ping_flag] | |
elif not(i%5) and i%3: | |
print buzz[fizz_ping_flag] | |
else: | |
print fizzbuzz[fizz_ping_flag] | |
fizzbuzz() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment