A simple, direct answer:
test_list = ['one', 'two','threefour']
r = [s for s in test_list if s.startswith('three')]
print(r[0] if r else 'nomatch')
Result:
threefour
Not sure what you want to do in the non-matching case. r[0]
is exactly what you asked for if there is a match, but it's undefined if there is no match. The print
deals with this, but you may want to do so differently.