Python - Group Consecutive elements by Sign
Given a list group of consecutive elements on the basis of signs. Input : test_list = [5, -3, 2, 4, 6, -2, -1, -7, -9, 2, 3] Output : [[5], [-3], [2, 4, 6], [-2, -1, -7, -9], [2, 3]] Explanation : Elements inserted into new list on sign change.Input : test_list = [-2,3,4,5,6,-3] Output : [[-2], [3, 4, 5, 6], [-3]] Explanation : Elements inserted in