Created
January 28, 2017 23:43
-
-
Save korneliakobiela/66ed286040950dae6fbc30d59004f602 to your computer and use it in GitHub Desktop.
This file contains 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
import math | |
n = int(input()) | |
for i in range(n): | |
a = int(input()) | |
tab = [] | |
m = math.floor(math.sqrt(a)) | |
t = True | |
if a<2: | |
t=False | |
else: | |
for j in range(2,m+1): | |
tab.append(j) | |
for j in tab: | |
if(a%j==0): | |
t=False | |
break | |
return t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment