serach in list, again??

jubafre at brturbo.com jubafre at brturbo.com
Mon Aug 19 15:21:49 EDT 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
	
	
	Juliano Freitas
www.gebrasil.hpg.com.br 


More information about the Python-list mailing list