Remove_duplicates


#1



https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/2/4?curriculum_id=4f89dab3d788890003000096#


https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/2/4?curriculum_id=4f89dab3d788890003000096#

I set up the loop. I havent been taught yet how to use not in like instructed. can someone give me an example?

all I have got is

def remove_duplicates(remove):
new_list = []
for i in remove:
new_list.append(i)
return new_list


Replace this line with your code.


#2

turns out we did lol in bad aim


#3

Did you solve the problem?


#4

No was going to retyrn to it tuesday/ tomorrow


#5

if you post an updated version of your code i can help you, but working on it yourself would be better :slight_smile:


#6

def remove_duplicates(remove):
new_list = []
second_list = []
for i in remove:
new_list.append(i)
for n not in new_list:
second_list.append(n)

return second_list

looking through my notes, it doesn't explain how not in works on lists. :unamused:


#7

well, both not and in should have been covered? Maybe not the combination of the two, but combined you should be able to understand them.

it is literaly what is says: if (or for) n which is not in new_list, append n to second list


#8

totally understand what you mean now, passed it :wink:


#9