python: remove the duplicates in a list
2016-12-25 22:49
381 查看
>>> t = [1, 2, 3, 1, 2, 5, 6, 7, 8] >>> t [1, 2, 3, 1, 2, 5, 6, 7, 8] >>> list(set(t)) [1, 2, 3, 5, 6, 7, 8] >>> s = [1, 2, 3] >>> list(set(t) - set(s)) [8, 5, 6, 7]
相关文章推荐
- python: delete the duplicates in a list
- eliminate the duplicates in the sorted list (2)
- Ch2-3: remove the middle node in a singly linked list
- 【Leetcode】Remove Duplicates from Sorted List in JAVA
- python: how to delete a given item if it exist in the list
- Remove duplicate in sorted linked list 1
- eliminate the duplicates in the sorted list (2)
- Python学习——leetcode(Remove Duplicates from Sorted List)
- [LeetCode]题解(python):082-Remove Duplicates from Sorted List II
- leetcode 【 Remove Duplicates from Sorted List 】 python 实现
- python: find the index of a given value in a list
- C# Remove Duplicates in List
- LeetCode 83 — Remove Duplicates from Sorted List(C++ Java Python)
- 【LeetCode with Python】 Remove Duplicates from Sorted List
- How to remove the ribbon tabs in list forms in SharePoint 2010
- 【3】Remove the duplicate characters in a string
- [leetcode]Remove Duplicates from Sorted List II @ Python
- remove the duplicate node from unsorted list
- 【LEETCODE】82- Remove Duplicates from Sorted List II [Python]
- [LeetCode]题解(python):083-Remove Duplicates from Sorted List