Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmourad marzouk
5,560 PointsDisemvowel challenge
This is what I have so far but not sure why its not working.
def disemvowel(word):
for vowels in word:
if vowels.upper() == 'A' or 'E' or 'I' or 'O' or 'U':
word.remove(vowels)
return word
word=[input("Please put in the word you like to remove vowels from\n > ")]
disemvowel(word)
print(word)
2 Answers
mourad marzouk
5,560 PointsOh I thought I did when I did word=[].
Akshaan Mazumdar
3,787 PointsOh yes ! did'nt see that ! . So yeah, in that case you need to change it back to a string before u return it.!
mourad marzouk
5,560 Pointsah ok I see, how would you do that? .join?
Akshaan Mazumdar
3,787 PointsYou can use join
or u can run another for loop to iterate through the list and concatenate all items together in a blank string
Akshaan Mazumdar
3,787 PointsAkshaan Mazumdar
3,787 PointsHey !
You need to convert the WORD to a LIST. That is because //remove()// does not work on strings.