Week 3 Programming Assignment 1 copy.deepcopy

Right, you have to be careful because objects are passed “by reference” in python. That means you may accidentally be modifying the global object. In this assignment it doesn’t matter because they changed the test cases so that they don’t fail if you modify the global objects. When you get to the same point in Week 4, that is not the case, so care is required.

Here’s a thread which discusses what’s going on here in more detail.

1 Like