fork download
  1. def czy_pierwsza(n):
  2. d = 2
  3. while d * d <= n:
  4. if n % d == 0:
  5. return False
  6. d+=1
  7. return True
  8. print (czy_pierwsza(11))
  9. print (czy_pierwsza(99))
Success #stdin #stdout 0.03s 9628KB
stdin
Standard input is empty
stdout
True
False