I need to remove the duplicates in 2ways, one being able to create a new list which i have done by:
def remove_extras(lst):
new_list = []
for number in list:
if number not in new_list:
new_list.append(number)
return new_list
I need a second method where i do not create a new list (order doesn't need to be preserved). I tried using set but it is not the same list as the original one hence doesn't pass the test. anyone has any hints or solutions? thanks