Previous
Functions
6 / 6
Next
Capstone
Hint
Implement a Python function sqrt(S, n)
that approximates the $n$-th root of a positive number $S$ using the Newton-Raphson method.
- Use a tolerance of 1e-8 (that is, 0.00000001).
- The value of
n
should default to $2$.
Hint: the $n$-th power of a variable x
can be computed in Python with x**n
.
Help
Solve
Reset
Test results
Test result #
Expected output
Your output