If every basic operation costs one unit, why does a nested loop cost 3n² + n + 1 rather than just 3n²?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
The video prices c*9.0/5 + 32 at 3 units of time, one unit for each basic operation in it. Count the operations in the body of this function the same way:
def poly(x): return 2*x*x + 5*x + 1
Assign the number of basic operations to ops.