scores = [86,86,85,85,85,83,23,45,84,1,2,0]
def find_h (alist):
f_list = []
for item in range (0, len (alist) + 1):
if alist[item] == alist[item +1]:
continue
else:
f_list.append (alist[item])
print (f_list)
#if item not in f_list:
#f_list.append (item)
find_h (scores)
The idea is to remove duplicates from, for sake of intuition, what is the best way to tackle this task?
How is it possible to break the condition and stop counting the, adding +1 to (alist[item +1]) because this works to a certain point
the output is: IndexError: list index out of range