def funz1(dates, k):
    result = [dates[0]]
for date in dates:
    if (date - result[-1]).days >= k:
        result.append(date)
keeping only elements in a list at a certain distance at least - changing iterator while looping - Python