How can a function with a loop still run in constant time, and why must you always name which input the complexity is measured against?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Return the sum of the first five elements of L (assume L has at least five). Use a for loop over range(5) and indexing, so the loop goes round the same number of times however long L gets. Define sum_first_five(L).