So say i have some `datetime.timedelta objects` stored in a dictionary and I plan on writing them to and output .txt file. I prefer this output file to be easily readable as to obtain information from it without wasting much time. So i definitely want to format these with something close to this i assume: 

`a_time_obj.strftime("%H:%M:%S")`

I also assume i will have to iterate over each object which I'm not quite sure how to do with with these `datetime.timedelta` objects. Can it be done? If so, what's the most pythonic way to accomplish this?

This is what i currently get as output when i write to a .txt file:

> 
> {'Monday': 0, 'Tuesday': 0, 'Friday': 0, 'Wednesday':
>  datetime.timedelta(0, 18, 496000), 'Thursday': 0, 'Sunday': 0,
>  'Saturday': 0}
> 
> 
> 

**EDIT** -- code: 

```
for key, value in get_weekly_hours.iteritems():
    formatted_value = value.strftime("%H:%M:%S")
return formatted_value

```

Error message:
for key, value in get\_weekly\_hours.iteritems():
 formatted\_value = value.strftime("%H:%M:%S")
 return formatted\_value Attribute:Error 'int' object has no attribute 'strftime'