On Wed, 12 Dec 2007 19:17:49 -0800, Yansky wrote: > Got a quick n00b question. What's the difference between del and remove?
Everything. list.remove(value) removes the first item equal to value. del list[index] removes the item at position index. See also: help([].remove) Help on built-in function remove: remove(...) L.remove(value) -- remove first occurrence of value >>> alist = [101, 102, 103, 104, 105] >>> alist.remove(103) >>> alist [101, 102, 104, 105] >>> del alist[0] >>> alist [102, 104, 105] -- Steven. -- http://mail.python.org/mailman/listinfo/python-list