Python Perfect Square Binomial