My solution looking for improvement


Looking for improvement i’d love to get feed back, and see what you came up with

def remove_duplicates(dup):
  dump = []
  dup_free = []
  for num in dup:
    if num not in dump:
  return dup_free    
print remove_duplicates([1,1,2,2,3,1,2,1,2,12]) 


why do you have 2 lists? Either get rid of dup_free and return dump or get rid of dump and do if num not in dup_free


I thought i needed a list to keep track of what was already in my list but yeah ^^ it doesn’t make much sens now that I think about it


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.