← 返回列表

Python3 列表List remove 方法

Python3 列表List remove 方法 #!/usr/bin/python3 list1 = ['physics', 'Biology', 'chemistry', 'maths'] list1.remove('Biology') print ("list now : ", list1) list1.remove('maths') print ("list now : ", list1)

Python3 列表List remove 方法

#!/usr/bin/python3

list1 = ['physics', 'Biology', 'chemistry', 'maths']
list1.remove('Biology')
print ("list now : ", list1)
list1.remove('maths')
print ("list now : ", list1)

打开资源 ↗

交流与评论