python list pop vs remove

Solutions on MaxInterview for python list pop vs remove by the best coders in the world

showing results for - "python list pop vs remove"
Lacie
17 Oct 2016
1>>> a = [9, 8, 7, 6]
2>>> del a[1]
3>>> a
4[9, 7, 6]
5
Baxter
28 Apr 2019
1>>> a = [0, 2, 3, 2]
2>>> a.remove(2)
3>>> a
4[0, 3, 2]
5
Duncan
01 Oct 2019
1>>> a = [4, 3, 5]
2>>> a.pop(1)
33
4>>> a
5[4, 5]
6