import math count = 0 num = 1 while count<10001: num +=1 if num > 1: for i in range(2, int(math.sqrt(num))+1): if (num % i) == 0: break else: print(num, "是质数") count +=1 else: print(num, "不是质数") print(count)