Hello, I am trying to sort a list by the second element index of the tuple but it’s not working. in this example. i want to sort by insurance cost instead of name
medical_records= list(zip(names, insurance_costs))
sorted(medical_records, key=lambda record:record)
print("Here are the medical records sorted by insurance cost: " + str(medical_records))
Thank you in advance!