I have a dictionary having its values as timestamp. Few keys have list of timestamps as values. I am trying to sum timestamps which is in value. But failing with below error:
Traceback (most recent call last):
File "testing.py", line 53, in <module>
for key, value in total_exam_items.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
Below is my code:
total_items = {'item1': ['0:02:00'], 'item2': ['0:02:13'], 'item3': ['0:04:53'], 'item4': ['0:00:31', '0:05:17'], 'item5': ['0:04:31'], 'item6': ['0:04:34'], 'item6': ['0:13:26', '0:04:24']}
output = defaultdict(datetime)
for key, value in total_items.iteritems():
output[key] += value
Not sure where I am doing wrong? Any suggestions please???