Skip to content

Tag: string-formatting

Think Python 2nd Edition Exercise 7-1

“Square Roots” loop: Copy the loop from “Square Roots” and encapsulate it in a function called mysqrt that takes a as a parameter, chooses a reasonable value of x, and returns an estimate of the square root of a. To test it, write a function named test_square_root that prints a table like this: He…