How can one wrapper time a function across nine input sizes, and why do the seconds it reports say more about your laptop than your algorithm?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
The timing wrapper is handed a function by name, with no parentheses, because it receives the function itself rather than a call. c_to_f and mysum are already defined for you. Assign the mysum function itself to chosen (do not call it on that line), set label to the name the function reports through __name__, and set result to what chosen gives for an input of 100.
def c_to_f(c):
return c * 9 / 5 + 32
def mysum(n):
total = 0
for i in range(n + 1):
total = total + i
return total