How to add list in a list?

The sense of the problem is that the flights sheet added sheet new_segment that contains the dictionary.
flights = list()
for recommendation in recommendations:
 new_segment = list()
....
 price = recommendation['fragment']
 new_segment[len(new_segment) - 1]['price on site'] = int(price['total']) + int(price['commissions'])
print(new_segment)
flights.append(new_segment)
 print(flights.count(new_segment))

Get
[{'price': 8550}]
1
[{'price': 9135}]
1
[{'price': 9252}]
1
[{'price': 10168}]
2

The output I get that list with a dictionary {'price': 10168} is found on the 1 and 3 positions, and should be only 3. How to deal with the problem?
August 19th 19 at 23:07
1 answer
August 19th 19 at 23:09
Solution
problem solved: it was in
new_segment.append(my_dict)
my_dict passed by reference, so any changes have to be duplicated

Find more questions by tags Python