I am running a for loop, in which the iterator loops through list of time based values.
for example this is what my list looks like
lst = ['00:00:01', '00:00:05', '00:00:07', '00:01:10', ... , '00:20:23']
I want to check if the minute part of the time data changes. If it changes then break the loop.
this is my code so far
time_lst = []
for time in lst:
minute = time[3:5]
if minute changes:
time_lst.append(time)
break
print(time_lst)
in the above program, how do I program the if condition?
I looked online but I could not find a good solution to this problem.
['00:00:07', '00:00:50' , '00:01:10']if you want to get00:00:50or00:01:10in list @Sashaank