Newton's square root approximate in Python & Perl