def find_vowels(string): vowels = 'aeiouAEIOU' result = [char for char in string if char in vowels] return result # 测试 print(find_vowels('Hello, World!')) # ['e', 'o', 'o']
上一篇:编写一个函数,输入一个字符串数组,只返回其中包含数字的字符串如果没有符合条件的字符串,返回空数组
下一篇:编写一个函数,输入一行JavaScript代码并返回可能的注释部分,且不包含空格。