Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement