SyntaxFix
Write A Post
Hire A Developer
Questions
Inspired by sverrir-sigmundarson's comment:
def time_to_sec(time_str): return sum(x * int(t) for x, t in zip([1, 60, 3600], reversed(time_str.split(":"))))