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 trialbehar
10,799 PointsI thought srings were immutable?
I dont get this, i thought strings were immutable. How does it want me to remove anything from it? I tried append each letter from the word into a list, but i couldent figure out how to do that. Halp?
def disemvowel(word):
word
return word
1 Answer
Steven Parker
231,269 PointsYou're right, strings are immutable. So in your function, you'll probably want to create a new string that has all the letters of the old one except the vowels, and then return that.
You could use a list but you could also build a string using concatenation.
behar
10,799 Pointsbehar
10,799 PointsCan you elaborate, what do you mean "buildi a string using concatination".
Steven Parker
231,269 PointsSteven Parker
231,269 PointsHere's an example of a loop building a new word from the letters of an old word (without any changes):