1>>> a = ['a', 'b', 'c', 'd']
2>>> a.remove('b')
3>>> print a
4['a', 'c', 'd']
1# delete by index
2a = ['a', 'b', 'c', 'd']
3a.pop(0)
4print(a)
5['b', 'c', 'd']
1l = ['Alice', 'Bob', 'Charlie', 'Bob', 'Dave']
2print(l)
3# ['Alice', 'Bob', 'Charlie', 'Bob', 'Dave']
4
5l.remove('Alice')
6print(l)
7# ['Bob', 'Charlie', 'Bob', 'Dave']
1>>> a=[1,2,3]
2>>> a.remove(2)
3>>> a
4[1, 3]
5>>> a=[1,2,3]
6>>> del a[1]
7>>> a
8[1, 3]
9>>> a= [1,2,3]
10>>> a.pop(1)
112
12>>> a
13[1, 3]
14>>>
1import random
2
3
4#Let's say that we have a list of names.
5listnames = ['Miguel', 'James', 'Kolten']
6#Now, I choose a random one to remove.
7removing = random.choice(listnames)
8#And to delete, I do this:
9listnames.remove(remove)