I have a list in Python, list1, and the following while loop:
j = 0
while list1[j] >= list1[j - 1] and j < len(list1):
# do something here and return k
# k is always incremented
j += k
I got the following error:
IndexError: string index out of range
How to fix this error?
j = 0toj = 1.