So here's the abstract code of what I'm trying to do in python.
list_ = []
dict_ = {}
for i in range(something):
get_values_into_dict(dict_)
list_.append(dict_)
dict_.clear()
print list_
Here when I clear the dict_, obviously the all the elements in the list_ are deleted as they're just address mapped to the variable dict_.
What, I want is to copy the instance of dict_ so that I can store it in the list_.
Can someone explain me a way to store the obtained dict in every loop into the list_? Thanks in advance.