emailtext = [ ["From", "[email protected]", "Mon", "Jan", "5", "09:14:16", "2008"], ["From", "[email protected]", "Fri", "Jan", "4", "18:10:48", "2008"], ] weekdays = dict() for items in emailtext: day = items[2] weekdays[day] = weekdays.get(day, 0) + 1 print(weekdays)
Output:{'Mon': 1, 'Fri': 1}