Skip to content

Instantly share code, notes, and snippets.

@jkopczyn
Created October 18, 2014 00:37
Show Gist options
  • Save jkopczyn/8c07053e09e405dffce8 to your computer and use it in GitHub Desktop.
Save jkopczyn/8c07053e09e405dffce8 to your computer and use it in GitHub Desktop.
This Resembles FizzBuzz
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