Refering to substring of list containing strings

Bjorn Pettersen bjorn at roguewave.com
Mon Apr 10 15:05:23 EDT 2000


That should work (except you can't assign to it -- strings are
immutable).  A little more context might clarify exactly what you're
trying to do...

-- bjorn

Peter Kovalsky wrote:
> 
> Hi,
> 
> I am new to Python and lately experienced a little problem. I have a list
> with several strings and have to modify these strings. Therefore I used a
> for-construct (for i in range(0, len(mylist)))- to operate every lists
> element. But how do I adress a substring in such a list? I tried a
>         mylist[i][lborder:rorder]
> - just like one would do with a simple string-var - wich won' t work. Any
> help would be greatly appreciated,
> 
> thanx in advance,
> 
> Peter Kovalsky
> --
> http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list