Skip to content

Instantly share code, notes, and snippets.


JeffersGlass/ Secret

Created Aug 30, 2020
What would you like to do?
from time import time
from math import floor, sqrt
from gpiozero import LED
redLed = LED(20)
greenLed = LED(12)
def isPrime(n):
for i in range (2,floor(sqrt(n))+1):
if n/i == floor(n/i): return False
return True
def listPrimesUpTo(num):
for i in range (2,num):
print(str(i) + " ", end = "")
if isPrime(i): print ("is Prime")
else: print ("is Composite")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.