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 trialPrem Yadav
7,346 Pointsnot able to solve this problem......
hey there In this program i have created a list for word and used try and except for vowel removing. but still not able to solve. Not getting where i'm doing mistake. please help to find out solution.
def disemvowel(word):
for letter in list(word):
try:
letter.remove('a') or
letter.remove('e') or
letter.remove('i') or
letter.remove('o') or
letter.remove('u')
except ValueError:
pass
else:
return word
1 Answer
Sneha Nagpaul
10,124 PointsHey Prem, This is how I would do it.
def disemvowel(some_string):
vowels = ['a','e','i','o','u']
for vowel in vowels:
some_string = some_string.replace(vowel,"")
return some_string
Mathew Tran
Courses Plus Student 10,205 PointsMathew Tran
Courses Plus Student 10,205 PointsHey Prem,
I think the approach of this is that you need to take smaller steps.
Some issues I noticed:
Hope this helps!
Matt