Perfect Square Coding Question For Python