Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. names = ["tom", "john", "sara" , "tamara" , "tom"]
  2. single_finds = []
  3. duplicate_finds = []
  4.  
  5. for i in names:
  6. if i in single_finds:
  7. duplicate_finds.append(i)
  8. else:
  9. single_finds.append(i)
  10.  
  11. print (single_finds)
  12. print (duplicate_finds)
  13.  
  14. ['tom', 'john', 'sara', 'tamara']
  15. ['tom']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement