Skip to content

Instantly share code, notes, and snippets.

@hahalim
Created December 25, 2018 11:37
Show Gist options
  • Save hahalim/067a05ff9abfba84b870915ed7749670 to your computer and use it in GitHub Desktop.
Save hahalim/067a05ff9abfba84b870915ed7749670 to your computer and use it in GitHub Desktop.
FIZZBUZZ Solution
chance = ""
while (chance!="no"):
try:
num = int(input("Please enter a number\n"))
if (num%5==0 and num%3==0):
print("FizzBuzz")
elif (num%5 == 0):
print("BUZZ")
elif (num%3 == 0):
print("FIZZ");
else:
print("number you entered was "+ str(num))
chance = input("Press any key to continue and type no to quit yes/no\n")
except ValueError:
print("Please enter a valid number")
chance = input("Press any key to continue and type no to quit yes/no\n")
@imranrbx
Copy link

Great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment