I have written below code:
dict1 = {7: 'Java', 4: 'JavaScript', 3: 'Python', 1:"C#"}
dict2 = dict1
del dict1
print(dict2)
My understanding is that both dict1
and dict2
are referring to the same object.
So, when I delete the object using one reference then I should get empty
{}
dictionary
, when printing using another reference.