sorry for a noob question, I'm new to python so here's my problem:

When trying to run the following code, with dates[0] defined by the user in previous code, for example-

`dates.append(2020 8 25)`

```
   for d in dates:
   checkexp = dates[d]
   if checkexp + timedelta(days = 7) < current:
        print('Food will expire within a week')

```

I get the error:
`list indices must be integers or slices, not datetime.datetime`

I'm probably just making a beginner mistake, but help would be appreciated!

If it's worth mentioning, the code run just before this works:

```
firstdate = dates[0]
print(firstdate.strftime('%d/%m/%y'))

```