Question on List processing

Steven D'Aprano steve at pearwood.info
Mon Apr 25 12:36:56 EDT 2016


On Tue, 26 Apr 2016 12:56 am, subhabangalore at gmail.com wrote:

> Dear Group,
> 
> I have a list of tuples, as follows,
> 
> list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA
[... 17 more lines of data ...]

Hi Subhabrata, and thanks for the question.

Please remember that we are offering help for free, in our own time. If you
want help from us, you should help us to help you.

It is very unlikely that many people will spend the time to study your data
in close enough detail to understand your requirements. Please give a
*simplified* example. Instead of 17 lines of repetitive data, use a "toy"
example that matches the format but without all the complicated details.
And format it so that it is easy to read:

input = [u"('a/b/ ','A')",
         u"('z/x/ ','B')",
         u"('b/d/ ','C')",
         ]

output = ????



> I tried to make it as follows,
[...]
> but not helping.

What do you mean, "not helping"? What happens when you try?

Please show a *simple* example, with no more than four or five lines of
*short, easy to read* text.

Remember, we are giving you advice and consulting for free. We are not paid
to do this. If your questions are too difficult, boring, tedious, or
unpleasant, we will just ignore them, so please help us to help you by
simplifying them as much as possible.

Thank you.




-- 
Steven




More information about the Python-list mailing list