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 trialMauro Y.
6,520 PointsThis script in not passing the challenge, but working in my machine. Why?
Made this script to remove vowels from some word. Work perfectly on my system, but is been refused by the challenge terminal. The platform alert is not helping, just says: Bummer! Try again! Some idea?
def disemvowel(word):
vogal = ['a', 'i','u', 'e', 'o', 'A', 'I', 'U', 'E', 'O']
i = 0
while i <= len(vogal) - 1:
j = 0
count = len(word)
while count >= 0 :
try:
word.remove(vogal[i])
except ValueError:
pass
count -= 1
i += 1
word = ''.join(word)
return word
1 Answer
Steven Parker
231,236 PointsThis worked for you?
When I tried it, I got this:
File "disemvowel.py", line 10, in disemvowel
word.remove(vogal[i])
AttributeError: 'str' object has no attribute 'remove'
But if I modify the program so that it does not have this error, it also passes the challenge.
Mauro Y.
6,520 PointsMauro Y.
6,520 PointsSorry. In fact the scrip is:
Steven Parker
231,236 PointsSteven Parker
231,236 PointsThat's the same change I made, and it passes the challenge as-is (though you don't need to print anything).