Skip to content

Instantly share code, notes, and snippets.

@accessnash
Created May 19, 2018 21:06
Show Gist options
  • Select an option

  • Save accessnash/d9c4f4e0ae8a5e05d2b9059ae19567f1 to your computer and use it in GitHub Desktop.

Select an option

Save accessnash/d9c4f4e0ae8a5e05d2b9059ae19567f1 to your computer and use it in GitHub Desktop.
def check_prime(nums):
if num <2:
return 0
myprimelist = [2]
j = 3
while j <=num:
for i in range(j,3,2):
if j % i ==0:
j += 2
break
else:
myprimelist.append(j)
j +=2
print(myprimelist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment