schedule = ['11010100','01100000'] #original schedule
freehours = [day.strip('0').count('0') for day in schedule]
Algorithm: convert to a string like '11010100', strip 0 chars from start and end ('110101') and count the 0 chars (2) that remain. Descriptively, all periods between the first and last filled period which are not filled are your free periods.
Extra geekery:
More efficiently, if working in C++ with an array of booleans: get an iterator for the array, run it through any 0 vals at the beginnning. Declare another and iterate backward from the end over any 0 vals. Then iterate the start iterator forward, counting any zeroes until you reach the end iterator.
However, if you had a very long list, it might be more efficient to only iterate forward, storing the position of the last 1 and adding the size of each space to a counter when encountering the next 1. This way the memory is read in contiguous blocks and the summation could be performed on a streaming input, even writing running totals to a socket.