def save(content):
filename='result.txt'
with open(filename,mode='w')as fp:
fp.write(str(content))
s=[35,31,41,28,45,45,50,30,56,49,38,38,51,57,26,32,45,33,56,28,
42,36,35,44,37,47,28,59,46,50,47,32,52,39,47,35,55,29,37,43,
39,34,55,35,41,55,36,59,46,57,41,47,52,27,42,36,32,43,32,
40,49,39,53,37,34,36,56,43,48,51,32,35,38,43,47,48,34,57,31,55,
31,40,47,41,36,34,30,44,55,50,59,28,33,47,48,43,33,53,38,27,50,
55,43,32,44,53,31,55,33,40,49,58,40,53,49,46,27,52,25,43,47,49,
49,35,49,25,47,43,59,25,58,57,54,31,43,33,47,30,34,35,27,40,
25,25,27,27,50,45,47,34,51,44,27,33,57,53,50,52,50,36,54,49,
38,45,31,40,59,32,34,50,46,52,28,34,59,52,59,32,34,48]
t=[1,1,1,0,1,1,0,0,1,0,1,0,1,0,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,0,1,0,0,1,0,0,0,
0,0,0,1,1,1,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,0,1,1,0,
1,0,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,1,0,
0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,1,1,0,
0,1,0,1,0,1,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,0,0,1,1,0]
列表s表示教职工的年龄,列表t是对应的调查结果,1表示已接种疫苗,0表示未接种
编写程序统计30~50岁(包括30,50)已接种疫苗的教职工数,并存入‘result.txt’中
如何用Python解决此类问题