Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Collections (2016, retired 2019) Lists Disemvowel

Immanuel wiessler
Immanuel wiessler
2,726 Points

question on vowelremover I am not sure how to return the final section of this code in a return statement

import time def vowel(word): vowel_letters=["a","A","e","E","i","I","o","O","u","U"] word_letter=[] for letters in word: word_letter.append(letters) for i in range (0,len(vowel_letters)): vowel_cosntant=vowel_letters[i] while vowel_cosntant in word_letter: print('Removing->{}'.format(vowel_cosntant)) word_letter.remove(vowel_cosntant) if vowel_cosntant not in word_letter: print(word_letter) for final_word in word_letter: time.sleep(0.1) print(final_word,end='')

disemvowel.py
def disemvowel(word):
    return word
Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,862 Points

Hi Immanuel,

Please ensure all your code is properly formatted using Markdown. There is a link to the Markdown Cheatsheet below the text entry box.

Thanks,

Alex

1 Answer

Steven Parker
Steven Parker
216,135 Points

It looks like your "disemvowel" function simply returns the argument it was given unchanged. This is the way the code starts out in the challenge.

The rest of the code (the unformatted part) appears to define a completely separate function named "vowel", which is not part of the instructions. The code for the challenge should all be done inside the "disemvowel" function.

Immanuel wiessler
Immanuel wiessler
2,726 Points

so i should formatted within the function rather then outside,However it would still works with the print statment

Steven Parker
Steven Parker
216,135 Points

The challenge only checks what the disemvowel function return‍s. The other function (named "vowel") will not be tried by the challenge.

You also don't need to "print" anything (and it won't help for passing the challenge).