Last active
February 25, 2021 20:07
-
-
Save UcheAnyiam/ab78c82f355bb91d86d44faaac764636 to your computer and use it in GitHub Desktop.
This is the source code that lists the prime number and the 'fizz' and 'buzz' numbers depending on the range choses.
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 number in range(2,101): | |
if number % 3 == 0 and number % 5 == 0: | |
print(number,"fizzbuzz") | |
continue | |
if number % 3 == 0: | |
print (number, "fizz") | |
continue | |
if number % 5 == 0: | |
print (number, "buzz") | |
continue | |
for x in range (2,number): | |
if number % x == 0: | |
print(number) | |
break | |
else: | |
print (number, 'prime') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment