I have a string that is in the format of '00:00' displaying the time, it can be any time. I would like to extract the hours and minutes into individual variables.
You may want
minutes be integers:
hours, minutes = map(int, "00:00".split(':'))
delimas delimiter. Returns a list:
"00:00".split(':') == ["00", "00"]
functionto each member of the iterable
map(int, ["00","00"])returns an iterable, whose members are integers.
a, b, c = iterableextracts 3 first values of
iterableand assigns them to variables called