计算质数和(2~299) sum=0 for n in range(2,300): for i in range(2,n): if n%i==0: break else: print(n,end=" ") sum=sum+n print() print("2-300之间素数和为:{}".format(sum))