I tried removing the duplicates using a double loop ><` def remove_duplicates(numbers): noDuplicate= for i in range(0,len(numbers)): for j in range(1,len(numbers)+1): if(numbers[j] == numbers(i)): noDuplicate.append(numbers(j)) else: noDuplicate.append(numbers(i)) noDupicate.append(numbers(j)) return noDuplicate Can it work using a double loop ? ><` .
Yes, it can.
Do I recommend it. No.
You already have the concept down but using the second loop is just wasting resources.
You should just simplify it to.
def remove_duplicates(aList): tmp =  for item in aList: if item not in tmp: tmp.append(item) return tmp
Or a single line,
def remove_duplicates(aList): return list(set(aList))
The above does not respect order mind you, but it is fast.
As always, as the programmer it is up to you on how you will handle something. If you need additional help feel free to ask.
Thank you for explaining it to me I really appreciate it . Your explanation really helped me .I will try to make the double loop work when I do I`ll show you the code again I will try not to trouble you too much :). Thank you for taking time to help me .Have a great day!!!