lines = ['Hey, how are you?\n', 'My name is Mathews.\n',
    'I hate vegetables\n', """French fries came out soggy
"""]
for line in lines:
    for word in line.split():
        if word.endswith(('?', '.', 'gy')):
            pass
String comparison in python words ending with