Removing a particular index from a list

Cyril Cheneson ccheneson at gmail.com
Thu Mar 22 09:14:31 EDT 2007


>>> li = ["sri", "s", "srikanth", "s"]

> And if I want to remove the last item ("s"), how do I remove it?
> li.remove(-1) doesn't do it. This is my problem.
>
> Thanks,
> Srikanth
>

li.pop() will remove the last element

Cyril



More information about the Python-list mailing list