Advertisement
Guest User

Untitled

a guest
Jun 24th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. '''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.
  2. Using loop or using sets
  3. '''
  4.  
  5. from sets import Set
  6.  
  7. def remove(a):
  8. return list(a&a)
  9.  
  10. a = Set([1,3,4,4,5,5,6])
  11. print remove(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement