pythagorean theorem python code