Python에서 리스트가 NoneType으로 변합니다. 도와주세요!!

VOWELS = "aeiouy" answer = '' def translate(phrase): a = list(phrase) answer = [] print(type(a)) try: for i in range(len(a)): if not a[i] in VOWELS: answer.append(a[i]) if a[i] != ' ': a.remove(a[i+1]) if a[i] in VOWELS and a[i-1] == a[i] == a[i+1]: answer.append(a[i]) a.remove(a[i-1]).remove(a[i]).remove(a[i+1]) return ''.join(answer) except Exception as ex: print(x) translate("hieeelalaooo")

NoneType object has no attribute 'remove'라고 뜨는데 분명히 a를 list로 했는데 왜 None타입이라고 나타나는지 이해가 되지 않습니다. ㅜㅜ

    아직 답변이 없어요.