eg:輸入:
[1, 2, 3, 4, 3, 5, 3]
刪除:3
結果: [1, 2, 4, 5]
def shan(lt, item):
count = lt.count(item)
if count == 0:
print('沒有元素,不能刪除')
return
for i in range(count):
lt.remove(item)
return lt
print(shan([1, 2, 3, 4, 3, 5, 3],3))
eg:輸入:
[1, 2, 3, 4, 3, 5, 3]
刪除:3
結果: [1, 2, 4, 5]
def shan(lt, item):
count = lt.count(item)
if count == 0:
print('沒有元素,不能刪除')
return
for i in range(count):
lt.remove(item)
return lt
print(shan([1, 2, 3, 4, 3, 5, 3],3))
## spring security https://github.com/jitwxs/blog-sample/tree/master
https://blog.csdn.net/zhuizhufanxin123/article/details/103982940