python error 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