Check For Perfect Square In Python