New palindrome function in pe4.py

Attempt at making it more Python-esque.