Q17Single correct5 Marks11 Dec 2022
L is a list of integers and has more than two elements like [..., n1, n2, n3, n4, n5, n6, ...]
Which of the following trend of elements' sequence in list L is checked by the above function check?
```
def check(L):
Inc = False
Dec = False
Prev = L[0]
for i in range(1, len(L)):
Next = L[i]
if Inc == False and Dec == False:
if Next > Prev:
Inc = True
Prev = Next
continue
else:
return False
if Inc == True and Dec == False:
if Next < Prev:
Dec = True
Prev = Next
continue
if Inc == True and Dec == True:
if Next > Prev:
return False
else:
Prev = Next
continue
if Inc == False and Dec == True:
if Next < Prev:
Prev = Next
continue
else:
return False
if Inc == True and Dec == True:
return True
else:
return False
```