I need to write function that will count how much numbers are ordered in ascending order in a row. for example: we have this list:
L = [2, 4, 5, 6, 7, 2, 3, 2, 2, 2, 8, 7, 5, 6]
and the largest ascending series of numbers are 5.
I've tried:
count=0
def ascord(L,count):
for i in range(0,len(L)-1):
if L[i]<L[i+1]:
count+=1
return count
but the output is 7. I don't know how to "reset" count so it wouldn't take [2,8] and [5,6] into consideration
Edit: I meant that if I for ex. add at the end of list twenty numbers in asc. order they will be largest series of numbers, so the first count should be set to 0, and start counting from start
PS. Sorry for my english.