so basically i know that shallow copy and deep copy varies. what i am trying to understand is that when i make a direct copy:
d1 = {"a": "1"}
d2 = {}
d2 = d1
d1["b"] = "2"
del d1
print(d2)
this returns the output as
{"a": "1", "b": "2"}
my question is why does this happen, and what can i do to not let this happen? i dont want d2 to change once i make the copy. Is there any way to do it without using copy.deepcopy()
?