fork download
  1. def suma_cyfr(liczba):
  2. suma=0
  3. while liczba<0:
  4. suma += liczba%10 # modulo to reszta z dzielenia - %
  5. liczba = liczba //10
  6. return suma
  7.  
  8.  
  9. def czy_pierwsza(liczba):
  10. if liczba<2:
  11. return False
  12. if liczba ==2:
  13. return True
  14. for i in range(3,liczba,1): #(start,stop,step)
  15. if liczba%i==0:
  16. return False
  17. return True
  18.  
Success #stdin #stdout 0.1s 14008KB
stdin
Standard input is empty
stdout
Standard output is empty