I have 2 functions. The one that's the second one being called, takes a local variable from the first function and modifies it. I would expect this to use copies and not modify the original local variable, but it seems to be modifying it.
Example:
def a():
dictionary = {"world": "hello"}
b(dictionary)
print(dictionary)
def b(dictionary):
dictionary["world"] = "goodbye"
a() # prints {'world': 'goodbye'} while I expect {'world': 'hello'}
What am I missing, isn't b
supposed to work on a copy?