mardi 23 novembre 2021

python : meaning of -----if not (p%q):

this is code i got from paper,

I want to know meaning of

if not (p%q)

x = 0
p = 2
while(p<7):
  q=2
  while(q<p):
    if not (p%q):q=p
    q+=1
  if(q>p):x+=p
  p+=1
print(x)`

Aucun commentaire:

Enregistrer un commentaire