-
-
Save imranrbx/ebc9ab2f89f08e3871dbdaaa63d9a487 to your computer and use it in GitHub Desktop.
FIZZBUZZ Solution
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
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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment