Last active
August 29, 2015 14:08
-
-
Save Ryanb58/6ae6834f6dead891d5a6 to your computer and use it in GitHub Desktop.
Fizz Buzz challenge in python.
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
for num in range(1, 101): | |
if num % 3 == 0 and num % 5 == 0: | |
print('FizzBuzz'); | |
elif num % 3 == 0: | |
print('Fizz'); | |
elif num % 5 == 0: | |
print('Buzz'); | |
else: | |
print(num); |
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
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment