Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''Write a program (function!) that takes a list and returns a new list that contains all the elements of the first list minus all the duplicates.
- Using loop or using sets
- '''
- from sets import Set
- def remove(a):
- return list(a&a)
- a = Set([1,3,4,4,5,5,6])
- print remove(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement