0

why there is pop(), remove(), but no del()?

I mean why you have to say del list[0] rather than list.del(0) ? thanks

26th Oct 2017, 8:37 PM
Lokvrm
2 Answers
+ 11
del is more universal and type-independent. It deletes any variable not just a list-type. Whilst pop() and remove() are list-bound methods.
26th Oct 2017, 11:32 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 1
It's programmer friendly
26th Oct 2017, 9:25 PM
Joshua
Joshua - avatar