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 trialAndrew Gursky
12,576 PointsCan anyone tell me what I did wrong here?
I ran this in the terminal and it works perfectly. - I've been using Python3 in the terminal btw.
print("Gimme a word. Any word.")
word = input("> ")
def disemvowel(word):
word = list(word)
list_of_nonos = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
for item in list_of_nonos:
while item in word:
word.remove(item)
word = ''.join(word)
return word
disemvowel(word)
2 Answers
james south
Front End Web Development Techdegree Graduate 33,271 Pointsyour function is fine you just need to not submit it with the print statement, don't ask for input, and don't call it, the autograder does that. only do what the challenge asks.
Anders Axelsen
3,471 PointsNice! What does the ''.join(word) actually do in this context?
Andrew Gursky
12,576 PointsWell at the beginning of the function I take the input (word) and turn it into a list of individual characters including the spaces) with word = list(word). At the end of the function ""word = '''.join(word)"" takes the list of characters and turns it back into a single string. the '' before join is what will connect the individual characters so if I had a list of characters ['p', 'i', 'e'], ''.join(['p', 'i', 'e']) it would return 'pie'. If I did 'a'.join('p', 'i', 'e') it would give me 'paiae'.
Andrew Gursky
12,576 PointsAndrew Gursky
12,576 PointsYou're right! Thanks so much!