how to start index from 0 in python when list index out of range code example
Example: list index out of range
def sort_list(l):
l=list(l)
for i in l:
if l[i]<=l[i+1]:
return True
else:
return False
def sort_list(l):
l=list(l)
for i in l:
if l[i]<=l[i+1]:
return True
else:
return False