Skip to content

Instantly share code, notes, and snippets.

@DoubleMalt
Forked from kiwiBBC/fizzbuzz.py
Last active November 14, 2017 17:44
Show Gist options
  • Save DoubleMalt/f838c5efd5d376ccd30d496b8181ae60 to your computer and use it in GitHub Desktop.
Save DoubleMalt/f838c5efd5d376ccd30d496b8181ae60 to your computer and use it in GitHub Desktop.
answer = int(raw_input("select a number between 1 and 100: "))
if answer < 1 or answer > 100:
print "Wrong number!"
else:
for x in range (1, answer + 1):
if x % 5 == 0 and x % 3 == 0:
print "fizzbuzz"
elif x % 5 == 0:
print "buzz"
elif x % 3 == 0:
print "fizz"
else:
print str(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment