I'm new to programming. I started doing this question where I have to make sub-lists of descending values from the given list.
input_list=[7,1,6, 17, 18, 25, 25, 21, 11, 5 ,3 ,3,26,25]
The expected output should be :
descend_lists=[[7, 1], [25, 25, 21, 11, 5, 3, 3], [26, 25]]
I've no idea where to start from. The idea I have in my mind is I check ith and ith+1 elements together if ith element is greater than ith+1 element then add both elements to descend_list. Please help me out.
descend_lists?descend_listsis a list of lists and every list present indescend_listsshould be sorted in descending order.[[5, 3], [7, 1], [26, 25], ...]or any other "valid" combination?