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

Jeremy Williams
Jeremy Williams
2,933 Points

EOFError

I'm having an EOFError when I attempt to run this code. It's supposed to be a function that takes in a word and removes the vowels from it before returning the word.

disemvowel.py
def disemvowel(word):
    word = input("What word would you like disemvoweled?/n> ")
    try:
        word.delete("A", "E", "I", "O", "U", "Y", "a", "e", "i", "o", "u", "y")
    except ValueError:
        pass
    return word

2 Answers

you are not being asked to take an input from a user. there is no such method as delete to lists.

read the instructions again

Jeremy Williams
Jeremy Williams
2,933 Points

I appreciate the response. I based that code off the example in the lesson prior to the challenge and I actually meant to remove the delete before I posted this but I forgot. Originally I had it as a remove but that didn't work and in my frustration I tried a few things that obviously also didn't work. I just can't seem to get this to function regardless of what I am trying and after watching the lesson again I'm still lost.

few hints, if u can’t solve his i will post the code. create an empty variable that will hold an empty string. 2.loop through the word. 3.check if each word is in aeiou. 4.if it’s not append it to the string variable and return it in the end

i hope it will help u