Last active
June 1, 2016 04:36
-
-
Save ltagliaferri/a750930fb47a94e203166744678ab98a to your computer and use it in GitHub Desktop.
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
# Define x | |
x = 0 | |
# Define for-loop that starts with x and uses the range function to go from 1 to 100 | |
for x in range(1,101): | |
# Print out "FizzBuzz" if a number in the range is divisible by 3 AND 5 | |
if x%3 == 0 and x%5 == 0: | |
print("FizzBuzz") | |
# Print out "Fizz" if a number in the range is divisible by 3 | |
elif x%3 == 0: | |
print("Fizz") | |
# Print out "Buzz" if a number in the range is divisible by 5 | |
elif x%5 == 0: | |
print("Buzz") | |
# Print out every other number in the range as the number itself | |
else: | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment