I am trying to write a code to take all the ascending order sequence from a list and print the sublist. How should I match the elements of the list?
I have tried iterating over the list and compare the elements but not working the way I want it to work.
def ascending_order_sequence(list1):
sublist = []
for i in range(len(no_list)):
for j in range(i + 1, len(no_list) + 1):
Dont know how to compare and then fetch the sublists
TEST CASE 1: [4,5,9,7,1,4,3,8,10]
OUTPUT: [4,5,9] [1,4] [3,8,10]
TEST CASE 2: [1,2,3,4,5,6]
OUTPUT : [1,2,3,4,5,6]
TEST CASE 3: [8,6,2,1,0]
OUTPUT: []