I recently took a coding challenge for python. My python skills are not the greatest and ran into a question that I was not able to answer and was hoping someone would be able to finally give me the answer since it didn't show how to actually do it.
essentially--
you are given a multiline list of conversations(strings) such-
conversation = ['john 10:23:14 hey hows its going?',
'sam 10:23:20 not much you?',
'carl 10:23:14 hey guys']
how would you filter that conversation by the persons name- and output what was said by them, and another content filter to search for a specific word and output the whole line. ex. if you search for the word 'guys', it would output, 'carl 10:23:30 hey guys' or if you search the word 'hey', it would output both lines that have that word.
winners = [c for c in conversation if 'guys' in c]
- Tim Roberts