The following code works in that it returns a de-duplicated list for any list I give it. The Codeacademy console shows a correct result with no errors, but in the code window displays the following illogical information:
Oops, try again. remove_duplicates([6, 8, 122, 2, 18]) returned [5, 4] instead of [8, 122, 18, 2, 6]
for item in mylist:
while clean.count(item) > 1:
messy = [4, 5, 5, 4]
clean = messy
Does CA recognize only one correct response? It's frustrating to write code that works but won't pass.
Thanks for any insights.