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))
  11.  
  12.  
Success #stdin #stdout 0.03s 9664KB
stdin
Standard input is empty
stdout
True
False