I am new to data structures in python and was wondering how do you simulate a thing like pointers in python so that multiple structures can refer and manage the same piece of data.
I have the following two structures
my_list = [1]
my_dictionary = {}
my_dictionary["hello"] = my_list[0]
and when I do the following I get True
id(my_dictionary["hello"]) == my_list[0]
However how can I force removal both from the dict and the list in one go? If I do the following my_dictionary still has a reference to my_list[0] i.e. 1
del my_list[0]
is there a way to get rid of both of these elements in one go? What is the python way of doing linked structures like this?