python写的判断数字是否为素数

def sushu(x):
 for m in range(1,x+1):

         y=0
         for i in range(1,m+1):
   if (i ==1 or i== m):
    continue
   if(m%i ==0):
    y=2
    #print m
    print m,"is not sushu"
    break
  if y == 0 :
   #print m
   print m,"is sushu"

 

你可能感兴趣的:(python写的判断数字是否为素数)