python中怎样删掉具有相同元素的字符串

如题所述

>>> a = [1, 2, 3, 1, 2, 3] >>> list(set(a)) [1, 2, 3] 先转成 set(set自动去重),再转成list就可以了
温馨提示:答案为网友推荐,仅供参考
相似回答