Assume that L is a list of Boolean values, True and False. Write a function longestFalse(L) which returns a tuple (start, end) representing the start and end indices of the longest run of False values in L. If there is a tie, then return the first such run. For example, if
L is False False True False False False False True True False False
then the function would return (3, 6), since the longest run of False is from 3 to 6
L = [False, False, True, False, False, False, False, True, True, False, False]
inRun = False
run = ""
for i in range(len(L)):
if inRun:
if L[i] != L[i-1]:
runs.append(run)
run = ""
inRun = False
continue
else:
run += str(L[i])
if not inRun:
if i != len(L)-1:
if L[i] == L[i+1]:
run += str(L[i])
inRun = True
I have this code so far but I am completely lost on how to proceed.