您可以使用以下内容查找列表中的任何字符串是否以
'x'
>>> [e for e in test if e.startswith('x')]['xzz', 'xaa']>>> any(e.startswith('x') for e in test)True
您可以使用以下内容查找列表中的任何字符串是否以
'x'
>>> [e for e in test if e.startswith('x')]['xzz', 'xaa']>>> any(e.startswith('x') for e in test)True