Python Function Finding Prime Factorization