Advertisement
elena1234

count duplicates in Python

Feb 8th, 2022
1,243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. some_list = ['a', 'b', 'c', 'b', 'd', 'm', 'n', 'n']
  2.  
  3. print(list({char for char in some_list if some_list.count(char) > 1}))
  4.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement