I used regex to find these dates in a string
matches = ['10 October 2019', '20 October 2019', '10 October 2019', '25 October 2019']
matches[0] and matches[2] are dates that a task was assigned, matches[1] and matches[3] are the due dates for the task. I need to check if the tasks are overdue, so I need to check if matches[1] and matches[3] are before today's date
This is what I have tried
index = 0
for random_value in range(0, len(matches)/2):
assert(matches[index]> date.today())
index += 2
This is the error message I am getting
TypeError: '>' not supported between instances of 'str' and 'datetime.date'
How do I convert the matches[index] into a format to be compared with the current date?