fork download
  1. pierwsze = [2,3,5,7,11,13,17,19,23,29]
  2.  
  3. def faktoryzuj(n) :
  4. if(n>1) :
  5. for x in pierwsze :
  6. while n%x==0 :
  7. n = n/x
  8. yield x
  9. if n==1 :
  10. return
  11.  
  12. print([i for i in faktoryzuj(42)])
Success #stdin #stdout 0.08s 8880KB
stdin
Standard input is empty
stdout
[2, 3, 7]