remove()从左到右寻找,移除找到的第一个指定元素,举个例子:
1 a = ["hello", "world", "world", "dlrb"]
2 a.remove("world")
3 print(a)
输出结果:
['hello', 'world', 'dlrb']
从左到右寻找,只移出找到的第一个world
|
remove()从左到右寻找,移除找到的第一个指定元素,举个例子: 1 a = ["hello", "world", "world", "dlrb"]
2 a.remove("world")
3 print(a)
输出结果: ['hello', 'world', 'dlrb'] 从左到右寻找,只移出找到的第一个world
|