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.  
  9. print (czy_pierwsza(11))
  10. print (czy_pierwsza(99))
Success #stdin #stdout 0.04s 9640KB
stdin
Standard input is empty
stdout
True
False