['aa', 'ab', 'aaaa', 'ggg', 'agaga', 'a']
From the above list, I'd like to be able to find out if the list contains a 'b' in the shortest possible ways. Thanks!
['aa', 'ab', 'aaaa', 'ggg', 'agaga', 'a']
From the above list, I'd like to be able to find out if the list contains a 'b' in the shortest possible ways. Thanks!
For substrings:
any('b' in s for s in input_list)
For full strings:
'b' in input_list
You can join the items an test for a b in the joined string:
'b' in ' '.join(your_list)