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 trialWaleed Aljarman
Courses Plus Student 947 Pointsremoving vowels
what is wrong with the code, do i have to make word.lower in the start of the code or is there a mistake in what i wrote.
def disemvowel(word):
list( word)
for letters in word:
if letter == 'a':
letter.remove('a')
if letter == 'A':
letter.remove('A')
if letter == 'e':
letter.remove('e')
if letter == 'E':
letter.remove('E')
if letter == 'o':
letter.remove('o')
if letter == 'O':
letter.remove('O')
if letter == 'u':
letter.remove('u')
if letter == 'U':
letter.remove('U')
if letter == 'i':
letter.remove('i')
if letter == 'I':
letter.remove('I')
return word
2 Answers
Afloarei Andrei
5,163 PointsI found some mistakes:
- you have a white space in 'list( word)' and also if you want to use that line you need to assign a variable.
- 'for letters in word' does not work because the 'word' is a string not a list. do the 1. if you want you'r for loop to work.
- in you'r 'for' loop you use the word 'letters' and after in 'if' you use 'letter'
If you correct those the code won't pass. Read this post if you didn't figure it out, it will help you understand why is not passing:
https://teamtreehouse.com/community/my-disemvowel-function-isnt-passing-the-challenge
Afloarei Andrei
5,163 PointsThe last part, after 'continue', remove it. Leave just the 'return'. Now, you have to return all the characters from 'n_vowel' JOINED together in a string. And you don't need to use 'str()' to do that because " ' '.join()" returns a string
Waleed Aljarman
Courses Plus Student 947 Pointsi re-read your comment and the example you gave me, it really helped. Thanks
Waleed Aljarman
Courses Plus Student 947 PointsWaleed Aljarman
Courses Plus Student 947 Pointsi read the link you sent me and it helped a lot, but i still have a problem, i think it is with converting the list to a string
""" def disemvowel(word):