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 trial

Python Python Collections (2016, retired 2019) Lists Disemvowel

EOF error in task window

The code is running fine in Workspaces, but getting EOF error in task window. Can anyone help me with why its happening. Thank you.

disemvowel.py
def disemvowel(word):
    word = input("Tell me a word:")
    print("The word you entered is: {} ".format(word))
    word_list = list(word)
    spare_list = list(word)
    vowel = ("aeiouAEIOU")
    for letters in word_list:
        if letters in vowel:
            spare_list.remove(letters)
    word = "".join(spare_list)
    print("The word after removing vowels looks like: {}".format(word))
    return word

disemvowel("word")

For this code challenge the word is passed into the function.

def disemvowel(word):

That means your code should be running using the variable word.

So to pass the challenge all you need to do is delete these two lines:

    word = input("Tell me a word:")
    print("The word you entered is: {} ".format(word))

Hope this helps!

1 Answer

Thank you Niall Williams. Now the code works fine.