d = {'a':'1', 'b':'2', 'c':'3'}
def change_d(d):
dd = {}
d = dd
print(d)
change_d(d)
print(d)
I suppose both print() should print out an empty dict, but they are different:
{}
{'a': '1', 'b': '2', 'c': '3'}
Why doesn't the assignment in the function change the original dict's value outside of the function?