[Solved] Write a function named containsLetter that identifies all of the strings in a list that contain a specified letter and returns a list of those strings [closed]


Is this ok ?

>>> def containsLetter(searchLetter, hulkLine):
...     return [x for x in hulkLine if searchLetter in x]
...
>>> containsLetter('i', hulkLine)
['like', "i'm"]
>>>

Or

>>> filter(lambda x: searchLetter in x, hulkLine)
['like', "i'm"]
>>>

4

solved Write a function named containsLetter that identifies all of the strings in a list that contain a specified letter and returns a list of those strings [closed]