A sensor program stores raw readings and its baseline in millivolts. Its gain is dimensionless. The following Python code runs at module level, creating two anonymous functions before updating the settings:
gain = 2 baseline = 5 live = lambda raw: gain * (raw - baseline) held = lambda raw, gain=gain: gain * (raw - baseline) gain = 4 baseline = 7 live_result = live(12) held_result = held(12)
Find live_result and held_result. Enter each result in mV, to the nearest integer.
Unlock full course notes by signing up
Follow function references after reassignment
A developer saves a reference to a Python anonymous function before replacing the function associated with its original variable. What does the final line print?