Update prime.py

changed the if statement to a while statement