Why must default parameters come last, and how does naming arguments at the call site free you from remembering their order?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
The helper below decides whether a guess is close enough to the square root of x. As written, the author's tolerance is welded into the body, so every caller gets the same one whether it suits them or not.
Rework it so that a caller may supply their own tolerance as a third parameter named epsilon, and still gets the author's 0.01 when they say nothing at all. Keep the name close_enough and keep guess and x as the first two parameters — and make sure nothing left in the body overwrites what the caller passed in.
Three ways to let a caller set epsilon
Record hard-coding epsilon inside bisection_root, taking it from a global variable, and adding it as a required second parameter, with the objection the video raises against each.
A default value, and the defaults-last rule
Write def bisection_root(x, epsilon=0.01), contrast the calls bisection_root(123) and bisection_root(123, 0.5), and record that def bisection_root(epsilon=0.01, x) is rejected.
Call-site forms, valid and broken
List bisection_root(123), bisection_root(123, 0.1) and bisection_root(x=123, epsilon=0.1) as calls that work, then record that bisection_root(epsilon=0.1, 123) errors and bisection_root(0.001, 123) silently computes the wrong root.