I am having trouble trying to sort a list of dictionaries based on a value matching a string. Here's an example:
test = [{'username': "1", "password": "test1"},
{"username": "3", "password": "test2"},
{"username": "5", "password": "test3"}]
I would like to sort this dictionary based on password = test3, so it would look like:
test = [{"username": "5", "password": "test3"},
{'username': "1", "password": "test1"},
{"username": "3", "password": "test2"}]
Any help would be appreciated. Thank you!