输出以元音字母(含大小写)开头的单词,需求如下:

python __开头的函数 python输出首字母开头的单词_首字母

运行结果截图:

python __开头的函数 python输出首字母开头的单词_python_02

python __开头的函数 python输出首字母开头的单词_python_03

 

python __开头的函数 python输出首字母开头的单词_python __开头的函数_04

python __开头的函数 python输出首字母开头的单词_python_05

代码实现如下:

lst = "aeiouAEIOU"
print('学号:***  姓名:***')
lisinput = []
lisout = []
for i in range(1, 6):
    ls = input('请输入第{}个英文单词:'.format(i))
    words = ls.split()
    for word in words:
        lisinput.append(word)
        if word[0] in lst:
            lisout.append(word)
print('输入的5个单词是:', lisinput)
print('首字母是元音的单词有:')
for n in lisout:
    print(n)


# CMU One python hello egg