📜  python 列表理解 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:34.501000             🧑  作者: Mango

代码示例7
fruits = ["apple", "banana", "cherry", "kiwi", "mango"]
newlist = []

for x in fruits:
  if "a" in x:
    newlist.append(x)

print(newlist)