python fjarlægja þáttur af listanum
myList.remove(item) # Removes first instance of "item" from myList
myList.pop(i) # Removes and returns item at myList[i]
eyða þáttur lista python
list.remove(element)
python hvernig á að fjarlægja atriði úr listanum
list.remove(item)
fjarlægja gildi frá python lista með því að verðmæti
>>> a = ['a', 'b', 'c', 'd']
>>> a.remove('b')
>>> print a
['a', 'c', 'd']
python eyða úr listanum
l = list[1, 2, 3, 4]
l.pop(0) #remove item by index
l.remove(3)#remove item by value
#also buth of the methods returns the item
hvernig á að eyða sérstakur þáttur af lista í python
# animals list
animals = ['cat', 'dog', 'dog', 'guinea pig', 'dog']
# 'dog' is removed
animals.remove('dog')
# Updated animals list
print('Updated animals list: ', animals)