给定一个数字列表,请编写一个函数,判断其中的数字是否是小写元音字母(a, e, i, o, u)
在ASCII表中的数字。如果是,则将对应数字转成对应的字符串格式的字母。最终返回翻译后的列表。
示例:
输入:[100,100,116,105,117,121]
,
输出:[100,100,116,"i","u",121]
。
题目来源:CodeWars:Is there a vowel in there?
def solution(nums: list) -> list:
# your code here
assert solution([100,100,116,105,117,121]) == [100,100,116,"i","u",121]
assert solution([118,103,110,109,104,106]) == [118,103,110,109,104,106]
assert solution([118,117,120]) == [118, "u",120]