So lets say I have this
Sentence = "A surprise to be sure but a welcome one"
keyword_list = ['surprise', 'welcome', 'one']
def or_maker(sentence):
for i in range(len(keyword_list)):
if keywordlist[i] in Sentence:
return keywordlist[i] or keywordlist[i + 1] or keyword_list[i + 2] or ... etc.
So hopefully when I call the function or_maker(Sentence) it returns to me
'surprise' or 'welcome' or 'one'
Is this possible in Python?