相关疑难解决方法(0)

如何在列表中找出以元音开头的单词?

words = ['apple', 'orange', 'pear', 'milk', 'otter', 'snake', 'iguana',
         'tiger', 'eagle']
vowel=[]
for vowel in words:
    if vowel [0]=='a,e':
        words.append(vowel)
    print (words)
Run Code Online (Sandbox Code Playgroud)

我的代码不对,它会打印出原始列表中的所有单词.

python search list

1
推荐指数
3
解决办法
2万
查看次数

标签 统计

list ×1

python ×1

search ×1