Perfect Square Function In Python Definition