I'm close, but not close enough


#1

Hey guys and/or gals,
I'm stuck on the anti_vowel exercise. I have an idea of what I need to do, but I just can't quite put the answer together. I'm sure you guys can help me out.
Here is my code -


def anti_vowel(text):
result = []
s = ""
for let in text:
if let not in "aeiouAEIOU":
result.append(let)
"".join(result)
return result


this is the error message I get...
" Oops, try again.
Your function fails on anti_vowel("Hey look Words!"). It returns
"['H', 'y', ' ', 'l', 'k', ' ', 'W', 'r', 'd', 's', '!']" when it should
return "Hy lk Wrds!". "

I understand why I am getting this error message, and I even understand that I need to use the join function, I just can't pull out the correct answer. Any advice and explanation would be greatly appreciated,
Thanks!

`


#2

You need to adjust it so result is equal to joining a string with the list.


#3

or include the join statement in the return line.


#4

Ah I see. I change my return line to...
return "".join(result)
...and it fixed it.
Thanks guys! Forward on I trudge


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.