You will write three small functions that estimate the left-hand and right-hand limits of a function at a point, and test continuity. The checker uses a hole, a jump and a smooth function.
The idea. The left-hand limit is the value of just below , and the right-hand limit is the value just above . For a tiny number , the numbers and estimate them. A function is continuous at when both estimates agree with each other and with the value.
Your tasks.
left_limit(f, a). Return f(a - h) for h = 0.0000001.right_limit(f, a). Return f(a + h) for the same h.is_continuous(f, a, value). Return True when both limits are within 0.001 of value, and False otherwise.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…