Skip to content

Instantly share code, notes, and snippets.

@ibotdotout
Last active August 29, 2015 14:24
Show Gist options
  • Save ibotdotout/067c8310320d21e7d78a to your computer and use it in GitHub Desktop.
Save ibotdotout/067c8310320d21e7d78a to your computer and use it in GitHub Desktop.
FizzBizz Nested If
x = 105
if x%7 == 0 and x%3 == 0 and x%5 == 0:
print("FizzBuzzBang")
elif x%7 == 0 and x%5 == 0:
print("BuzzBang")
elif x%7 == 0 and x%3 == 0:
print("FizzBang")
elif x%3 == 0 and x%5 == 0:
print("FizzBuzz")
elif x%7 == 0:
print("Bang")
elif x%5 == 0:
print("Buzz")
elif x%3 == 0:
print("Fizz")
else:
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment