Created
September 7, 2017 10:12
-
-
Save anonymous/0f30fdac699b9691f6ec282d6ec61042 to your computer and use it in GitHub Desktop.
FizzBuzz
This file contains 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
for i in range(1, 101): | |
fizz = False | |
buzz = False | |
if i % 3 == 0: | |
fizz = True | |
if i % 5 == 0: | |
buzz = True | |
if fizz and buzz: | |
print("FizzBuzz") | |
elif fizz: | |
print("Fizz") | |
elif buzz: | |
print("Buzz") | |
else: | |
print(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment