Assume you are given a function f that takes exactly one argument, and a value x that f accepts.
Write the function time_call(f, x), which runs f on x exactly once and returns a two-element tuple: the number of seconds that call took, followed by whatever f returned. The seconds must come from the system clock, and the call must be made by time_call itself — f arrives by name, not already called.
def c_to_f(c): return c*9.0/5 + 32 time_call(c_to_f, 37) # (2.1457672119140625e-06, 98.60000000000001)
The first element will of course come out differently on every run and on every machine; only its meaning is fixed.