CodeChef: Practical coding for everyone - link to my solution
It is giving correct output on sample test cases.
try:
t = int(input())
if (t>=1 and t<=20):
while(t!=0):
n = int(input())
flag = 1
if (n>=1 and n<=100000):
if n>=2:
for i in range(2, n//2):
if n%i == 0:
flag = 0
break
if flag == 1:
print("yes")
else:
print("no")
t-=1
except Exception as e:
print("Error: ",e)