Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # remdups_noloop.py
- # Eliminating duplicate elements without looping
- a = [1,2,1,4,5,2]
- b = list(set(a)) # [1,2,4,5]
- print b
- a = '123abc123'
- b = ''.join(list(set(a))) # 123abc
- print b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement