# prize35-2 Exercise 2: find the leakiest link in an invented pond food chain levels = [("algae", 8000.0), ("water fleas", 1200.0), ("minnows", 150.0), ("perch", 30.0), ("heron", 1.5)] worst = None for (lower, e_low), (upper, e_up) in zip(levels, levels[1:]): eff = e_up / e_low print(f"{lower:12s} -> {upper:12s} efficiency {eff:6.1%}") if worst is None or eff < worst[0]: worst = (eff, lower, upper) print(f"leakiest link: {worst[1]} -> {worst[2]} at {worst[0]:.1%}") # Output: # algae -> water fleas efficiency 15.0% # water fleas -> minnows efficiency 12.5% # minnows -> perch efficiency 20.0% # perch -> heron efficiency 5.0% # leakiest link: perch -> heron at 5.0% # Why the perch -> heron link may be low: the heron is warm-blooded, so it burns much of what # it eats keeping its body warm and active, and only a small share becomes new tissue; it also # eats other prey and cannot use every part of a perch (bones, scales).