"""
@author:Hao
@file:case5py
@time:2022/05/26
"""
def judgePrimeumber(num):
judge = True
if num<=1:
return False
for i in range(2,int(pow(num,0.5))+1):
if num%i==0:
judge = False
break
return judge
if __name__ == '__main__':
file = open("res.txt", 'w').close()
count = 0
for i in range(2,20220520):
if judgePrimeumber(i):
strs = str(i)
length = 0
for j in range(len(strs)):
if judgePrimeumber(int(strs[j])):
length +=1
if length==len(strs):
count+=1
with open('res.txt','a') as fp:
fp.write(strs)
fp.write('\n')
with open('res.txt', 'a') as fp:
fp.write('结果{}'.format(count))