obj -- 這是要從列表中刪除的物件。
#!/usr/bin/python3 list1 = ['physics', 'Biology', 'chemistry', 'maths'] list1.remove('Biology') print ("list now : ", list1) list1.remove('maths') print ("list now : ", list1)
list now : ['physics', 'chemistry', 'maths'] list now : ['physics', 'chemistry']