Update problem_003.py

this prints the prime factors once and the composite factors twice. Suggest changes. 
I am not able to design an isprime(int) function too