I am trying to remove all items that have a due date equal to the current day, however, when I use this code because I am removing items from the list it changes the length and then I get the error list index out of range. How do I fix this?
for i in range(len(self.__items)):
if(self.__items[i]['duedate']==self.__currentDay):
self.__items.remove(self.__items[i])
self.__numItems-=1