Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- names = ["tom", "john", "sara" , "tamara" , "tom"]
- single_finds = []
- duplicate_finds = []
- for i in names:
- if i in single_finds:
- duplicate_finds.append(i)
- else:
- single_finds.append(i)
- print (single_finds)
- print (duplicate_finds)
- ['tom', 'john', 'sara', 'tamara']
- ['tom']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement