mutated

Unsure why dictionary is mutating

喜夏-厌秋 提交于 2019-12-02 08:18:44
Doing a self-study of Python via MIT Open Courseware, and ran into a problem with this bit of code below. When I run this function either alone or within another function, it mutates the originally passed value 'hand', and I am not sure why. I set two local variables (hand0 and tester) to hand, the first to preserve the initial value, and the second to iterate over. However, all three change, while I'm only expecting 'tester' to do so. Other than mutating 'hand', the function works as expected. (Values as passed to the function vary within set parameters: word_list is a list of valid English