I'm trying to create a python script that loops through an array of entries and adds a new day object with a date if that date is not already in the date list.
entryList = [aDate,anotherDate,fooDate]
history = [aDate]
for entry in entryList:
for day in history[:]:
if day.date == entry.date:
break
else:
dayEntry = dayEntry()
dayEntry.date = entry.date
history.insert(0,dayEntry)
break
according to this: https://docs.python.org/3/tutorial/controlflow.html it should work, but I'm missing something.
thanks--
dictinstead of alistseems better suited here.