我只是偶然发现如何检查字符串是否以元音开头?
def f(s):
s = s.split(' ')
for word in s:
if word.startswith(any('aeiou')):
print('starts with a vowel')
print(s)
r = 'd sljf l23j lekj 023 fls erj 50 isdl usdlw '
f(r)
但是它给出了错误,出了什么问题?any() 是一个 bool 函数,它应该打印出以元音字母开头的单词
杨__羊羊
相关分类