Basically I have the inverse of this problem: Python Time Seconds to h:m:s
I have a string in the format H:MM:SS (always 2 digits for minutes and seconds), and I nee
Expanding on @FMc's solution which embodies half of Horner's method. Advantage of Horner's method: Skip reversing the list, avoid power calculation.
from functools import reduce timestamp = "1:23:45" reduce(lambda sum, d: sum * 60 + int(d), timestamp.split(":"), 0)