I want the python code of this process

Start time End time
7:00 13:00
7:00 19:00
7:00 13:00
13:00 19:00
7:00 13:00
7:00 19:00
7:00 19:00
7:00 19:00
7:00 13:00
7:00 13:00
7:00 13:00
OFF
OFF
OFF
OFF
OFF
OFF
13:00 19:00
7:00 13:00
7:00 13:00
7:00 13:00
7:00 19:00
7:00 19:00
13:00 19:00
19:00 7:00
7:00 13:00
7:00 13:00
7:00 13:00
7:00 19:00
7:00 19:00
This is just a shift schedule of a shiftworker in a month.i want to calculate total time hours up to each working time day start and end like this. ((7,13),7),((31,43),31),((55,61),55),… like this.Although off days are not showing time spending for that also should want to be added for the start time after off day.Please suggest me a python code for this

What have you tried so far?

Do you have sample code detailing what is failing or what hasn’t worked thus far?