Re: how to search item in list of list

2016-06-13 Thread Larry Hudson via Python-list
On 06/12/2016 08:29 PM, meInvent bbird wrote: once a nested list have a word "node" then true else false def search(current_item): if isinstance(current_item, list): if len(current_item)==4: if [item for item in current_item if item[4] == "node"] != []:

Re: how to search item in list of list

2016-06-12 Thread Jussi Piitulainen
meInvent bbird writes: > once a nested list have a word "node" then true else false > > def search(current_item): > if isinstance(current_item, list): > if len(current_item)==4: > if [item for item in current_item if item[4] == "node"] != []: > return True

how to search item in list of list

2016-06-12 Thread meInvent bbird
once a nested list have a word "node" then true else false def search(current_item): if isinstance(current_item, list): if len(current_item)==4: if [item for item in current_item if item[4] == "node"] != []: return True if True in [search(item) for