PE Problem 29 Python

Problem 29 PE solution in Python
runs quick enough