In python how do I sum up the following time?
0:00:00 0:00:15 9:30:56
lines = ["0:00:00", "0:00:15", "9:30:56"] total = 0 for line in lines: h, m, s = map(int, line.split(":")) total += 3600*h + 60*m + s print "%02d:%02d:%02d" % (total / 3600, total / 60 % 60, total % 60)