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

Kushagra Patel
Kushagra Patel
7,740 Points

EOF error Disemvowel challenge

I ran this code in local idle and it ran perfectly but here it is showing EOF? Any help pls?

disemvowel.py
def disemvowel(word):
    abc=[]
    lower_word=word.lower()
    new_list = list(lower_word)
    for iterable in lower_word:
        if iterable=='a' or iterable=='e' or iterable=='i'or iterable=='o'or iterable=='u':
            new_list.remove(iterable)
            abc=''.join(new_list)
    return abc

word_noise = input("Enter a string \n")
vowel_less_string=disemvowel(word_noise)
print(vowel_less_string)

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Kushagra Patel ! You're doing great, but those last three lines of your code you added for testing purposes which is great! But now, you're asking for a computer at the other end to put in a string and that's not going to happen. Treehouse will call your function and send in its own string (without needing the input() function).

Erasing the bottom three lines will get rid of the EOF error, and you will be presented with a new problem to solve :smiley: Hint: the capitalization of the word should remain intact.

Hope this helps! :sparkles:

Kushagra Patel
Kushagra Patel
7,740 Points

Thanks a lot for your help Jennifer.