String to sequence

S Arrowsmith sion at paintbox.UUCP
Mon Mar 16 09:09:26 EDT 2009


Peter Otten  <__peter__ at web.de> wrote:
>assert s.startswith("[")
>assert s.endswith("]")
>s = s[1:-1]

s.strip('[]')

(I suppose it all depends on how much you can trust the consistency
of the input.)

-- 
\S

   under construction




More information about the Python-list mailing list