list permutations and weired list.remove funtion

Tim Gahnström /Bladerman tim at bladerman.com
Tue May 15 01:05:43 CEST 2001


Hi
I am new to python and happende to use the function list.remov(elem) it sure
is usufull but it rendered me som hours of extra work until I found out that
it really dont return the list with the elemen removed.

[1,2,3].remove(2) == null
instead of
[1,2,3].remove(2) ==[1,3]

It seems like it would have been about no cost to let it work that way to?

Another question.
Is there an easy way to get al permutations of a list?
eg.
perms=list.perm()
etc?

Thanks alot in advance
Tim





More information about the Python-list mailing list