serach in list, again??
marklists at mceahern.com
Mon Aug 19 22:09:04 CEST 2002
> ok the first step i understod, i want to get the next one to the
> ":" position
> x=['LDA', 'D1', 'ADD', 'D2', 'STA', 'D3', 'HLT', 'D1:', 'DB',
> '3', 'D2:', 'DB', '2', 'D3:', 'DB', '0']
> filtered_list = [el for el in arqui if el.find(":") >= 0]
> print filtered_list
> ['D1:', 'D2:', 'D3:']
> i have the DB after D1: and the others labels
So that we don't continue failing to read your mind--why not be clear and
explicit about the output you expect? Chances are, if you do that and apply
a little elbow grease, you'll solve this problem yourself.
More information about the Python-list