Python Perfect Square Trinomial