Help with using sorted in python pls

Hello, I am trying to sort a list by the second element index[1] of the tuple but it’s not working. in this example. i want to sort by insurance cost instead of name

https://www.codecademy.com/paths/data-analyst/tracks/dacp-python-fundamentals/modules/dscp-python-lists/projects/ds-python-lists2-project

medical_records= list(zip(names, insurance_costs))

#print(medical_records)

sorted(medical_records, key=lambda record:record[1])

print("Here are the medical records sorted by insurance cost: " + str(medical_records))
Thank you in advance!

The sorted function does not act on the existing list. It creates a new one. You can either use the .sort() method of the existing list or you can work with what sorted returns.