Created
May 19, 2018 21:06
-
-
Save accessnash/d9c4f4e0ae8a5e05d2b9059ae19567f1 to your computer and use it in GitHub Desktop.
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
| 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