码迷,mamicode.com
首页 > 编程语言 > 详细

Python 数组的移除

时间:2020-03-04 17:40:18      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:color   int   move   pre   ==   remove   移除   span   数组   

# 数组的移除
arr = [a,b,c]
arr.remove(b)
print(arr)

 

arr = [a,b,c]

for item in arr:
    if item==b:
        arr.remove(b)

print(arr)

 

Python 数组的移除

标签:color   int   move   pre   ==   remove   移除   span   数组   

原文地址:https://www.cnblogs.com/guxingy/p/12410737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!