How can I find the duplicates in a Python list and create another list of the duplicates? The list only contains integers.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Some other tests. Of course to do...
...is too costly. It's about 500 times faster (the more long array gives better results) to use the next final method:
Only 2 loops, no very costly
l.count()
operations.Here is a code to compare the methods for example. The code is below, here is the output:
The testing code: