You most first check if date string work as date object.
The first and last name should maybe not be split up,could be one string
>>> from datetime import datetime >>> datetime.strptime('26/06/1950', '%d/%m/%Y') datetime.datetime(1950, 6, 26, 0, 0)Now can sort bye dates.
>>> lst = [['WILSON', 'MIKE', 'H', '26/06/1950'], ['EMERIC', 'JAMES', 'H', '27/06/1960'], ['MOPAL', 'ARTHUR', 'H', '27/06/1966']] >>> sorted(lst, key=lambda item: datetime.strptime(item[3], '%d/%m/%Y'), reverse=True) [['MOPAL', 'ARTHUR', 'H', '27/06/1966'], ['EMERIC', 'JAMES', 'H', '27/06/1960'], ['WILSON', 'MIKE', 'H', '26/06/1950']]
reverse
it will be from oldest to youngest.The first and last name should maybe not be split up,could be one string
'WILSON MIKE'
.