date_list = [{"date":"2019-05-12"},{"date":"2019-05-10"},
{"date":"2019-05-14"},{"date":"2019-05-20"},
{"date":"2019-03-12"},{"date":"2019-08-12"}]
In this way, how can we sort by date when the date-time dictionaries in the list are randomly placed?
python
sorted(date_list, key=lambda e:e['date'])
© 2024 OneMinuteCode. All rights reserved.