tables = ['projname:dataset.devices', 'projname:dataset.attempts']
nouns = ['devices', 'today']
for noun in nouns:
    for table in tables:
        if noun in table:
            print('Found', noun)
break
Find matching partial substring in python