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?
convert = lambda n: n + 9 saved = convert convert = lambda n: 2 * n print(saved(4), convert(4))
8 8
8 13
13 13
13 8
Unlock full course notes by signing up
Separate stored defaults from current settings
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:
Find live_result and held_result. Enter each result in mV, to the nearest integer.