lesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict buglesson 2 of 2 · shallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bugshallow copy, deep copy, and the nested-dict bug
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving.
Last one. Cursor wrote apply_discount, a function that's supposed to
take a list of order dicts and a percent, and return a new list of
orders with the discount applied. The original orders should be unchanged.
Two bugs: it uses .copy() instead of deepcopy (so the inner dicts are
shared), and it returns the wrong variable.
Fix the function so the script prints:
original first price: 100
discounted first price: 90.0