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

EOFError

Hi guys,

I'm not sure why I'm getting an EOF Error here.

Please advise.

disemvowel.py
def disemvowel(word):

    word = input("What is your favourite colour?\n> ")

    remove_vowels = ["A","E", "I", "O", "U", "a", "e", "i", "o", "u"]

    try: 
        word.remove(remove_vowels)

    except ValueError:
        pass

        return word

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 67,986 Points

The input statement is not needed. The challenge checker will call the function by supplying a string argument. This string will be automatically assigned to word. By including the input statement, the checker hangs since it is not expecting to supply any input.

Also, since word is a string (type str), the isn't a .remove() method available.

Post back if you need more help. Good luck!

Thanks Chris, can I create a .remove() method or is that not necessary?

Ben

Chris Freeman
Chris Freeman
Treehouse Moderator 67,986 Points

You can not add methods to built-in types such as str. You could create your own class that extends str but that is way beyond what is necessary to solve this challenge.