1. 인덱스 기반 삭제
1.1 List.pop( 인덱스 )
>>> a = [1, 2, 3, 4, 5, 6, 7]
>>> a.pop(0)
>>> a
[2,3,4,5,6,7]
1.2 del List[ 인덱스 ]
>>> a = [1, 2, 3, 4, 5, 6, 7]
>>> del a[0]
>>> a
[2, 3, 4, 5, 6, 7]
1.3 del List[ List.index( 아이템 ) ]
>>> a = [1, 2, 3, 4, 5, 6, 7]
>>> del a[a.index(3)]
>>> a
[1, 2, 4, 5, 6, 7]
아이템 기반 삭제 : .remove()
List.remove( 아이템 )
>>> a = [1, 2, 3, 4, 5, 6, 7]
>>> a.remove(3)
>>> a
[1, 2, 4, 5, 6, 7]
>>> a.remove(9)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list