I've been stuck on this for a while now. It sounds simple enough but here's the code I've been working with so far. Basically the function is passed a bunch of numbers in a list for example a_list = [1,2,3,3,4,3]
and I should get [1,2,3,4,3]
def remove_doubles(a_list):
print()
new_list = []
for i in range(len(a_list)):
if a_list[i] != a_list[i+1]:
new_list.append(a_list[i])
return new_list