Update prime.py

added loop function.
Merge pull request #1 from fromwarriors/patch-1

Update prime.py