我在 Python 中有一个单词列表:
['apple', 'ball', 'app']
我想删除所有不以'app'.
'app'
如何生成列表['apple', 'app']?
['apple', 'app']
我知道使用startswith,但我不确定列表理解会是什么样子。
startswith
python list
list ×1
python ×1