python删除列表大于某值的方法
**
此文章转载自https://www.cnblogs.com/CDPJ/p/13021532.html 仅用于笔记作用**
### Py去除列表中小于某个数的值
print('*'*10,'Py去除列表中小于某个数的值','*'*10)
nums = [2,3,4,10,9,11,19,14]
print('*'*10,'remove之后改变了索引顺序,所以结果不正确!','*'*10)
for i in nums:
if i<5:
nums.remove(i)
print
转载
2020-07-22 21:18:29 ·
11093 阅读 ·
0 评论