[Tutor] string to list

Stefan Behnel stefan_ml at behnel.de
Wed Feb 10 13:32:15 CET 2010


Owain Clarke, 10.02.2010 12:26:
> Please excuse the obviousness of my question (if it is), but I have
> searched the documentation for how to generate a list e.g. [(1,2),
> (3,4)] from a string "[(1,2), (3,4)]". I wonder if someone could point
> me in the right direction.

You may want to add a little bit about your use case. Is that really the
input you have to deal with? Where does it come from? Can you control the
format? What do you want to do with the list you extract from the string?

All of that may have an impact on the right solution.

Stefan



More information about the Tutor mailing list