My solution to "remove_duplicates"



This is my solution to the remove_duplicates lesson. Did you find a better one? Post it!

def remove_duplicates(nums):
  new_list = []
  new_list1 = []
  for i in nums:
    if i not in new_list:
    elif i in new_list:
  return new_list1

Have a nice day!


why do you have both new_list and new_list1? They seem to do the same thing

elif is absolutely not doing anything, you can get rid of it.


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