Skip to content

Instantly share code, notes, and snippets.

@UcheAnyiam
Last active February 25, 2021 20:07
Show Gist options
  • Save UcheAnyiam/ab78c82f355bb91d86d44faaac764636 to your computer and use it in GitHub Desktop.
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.
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