Let lst = [13, 1, 14, -64, 9, -64, 14, 5]
How can I create a list of lists without taking into account the negative number ?
Result would be [[13,1,14], [9], [14,5]]
lst = [13, 1, 14, -64, 9, -64, 14, 5]
lst_index = []
for i,v in enumerate(lst):
if lst[i] == -64:
lst_index.append(i)
So this is what I have done to retrieve the index of each negative number. Now I should remove it from the list and create list of lists but how?? Thank you !