For the following list:
test_list = [\'one\', \'two\',\'threefour\']
How would I find out if an item starts with \'three\' or ends with \'f
You could use one of these:
>>> [e for e in test_list if e.startswith('three') or e.endswith('four')] ['threefour'] >>> any(e for e in test_list if e.startswith('three') or e.endswith('four')) True