python列表去重的二种方法
时间:2022-06-02 05:21:41
#第一种
def delRepeat(liebiao):
for x in liebiao:
while liebiao.count(x)>1:
del liebiao[liebiao.index(x)]
return liebiao
#第二种 无法保持原有顺序
liebiao=set(liebiao)
标签:python,列表,去重
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
php filter协议使用方法
2023-05-29 19:36:40
![](https://img.aspxhome.com/file/2023/5/55335_0s.png)
Python数据分析之使用scikit-learn构建模型
2023-11-10 23:19:10
![](https://img.aspxhome.com/file/2023/5/64365_0s.jpg)
使用DIV+CSS设计网页的好处
2007-10-14 15:02:00
Python实现自动发消息自定义内容的操作代码
2023-10-17 18:01:53
![](https://img.aspxhome.com/file/2023/5/63555_0s.jpg)
go语言csrf库使用实现原理示例解析
2023-08-07 03:34:38
![](https://img.aspxhome.com/file/2023/7/97167_0s.jpg)
2007淘宝UED招聘题解(前端开发部分)
2007-11-24 10:32:00
对“打造自己的reset.css”文中观点的不同看法
2009-03-08 18:05:00
![](https://img.aspxhome.com/file/UploadPic/20093/8/2009-03-08_000700-59s.gif)
合理利用页面标签元素有利用搜索引擎收录
2008-11-03 11:49:00
网页设计详细教程之XML简便省力技巧五则
2008-05-23 14:37:00
某一公司的ASP面试题
2011-09-15 20:50:20
CentOS 6.5中安装Python 3.6.2的方法步骤
2022-10-11 09:13:43
如何避免查询调查结果时出现不相关主题的重复记录?
2009-11-07 18:42:00
Django实现分页功能
2023-04-04 11:00:56
![](https://img.aspxhome.com/file/2023/4/72104_0s.png)
SQL Server可写脚本和编程扩展SSIS包
2009-01-20 16:29:00
PHP面向对象程序设计子类扩展父类(子类重新载入父类)操作详解
2023-10-15 01:41:57
Python实现的求解最小公倍数算法示例
2022-12-11 04:50:03
Javascript的数组总结
2009-02-03 13:07:00
揭秘SQL Server 2008性能和可扩展性
2009-03-10 14:47:00
![](https://img.aspxhome.com/file/UploadPic/20093/2009311124434637.jpg)
php自定义函数实现二维数组按指定key排序的方法
2023-06-27 09:54:36
Python实现曲线拟合的最小二乘法
2022-03-24 16:13:25