Welcome to the Treehouse Community
Looking to learn something new?
Mark Nembhard1,387 Points
End of file error comes up on my code when i run the dismevowel task
EOFError:EOF and i am not sure why?
def disemvowel(word): word = input(" what is the word you wish to enter?") name = word.lower() a = 0 for w in name: if w == "a": del word[a] elif lower(w) == "e": del word[a] elif lower(w) == "i": del word[a] elif lower(w) == "o": del word[a] elif lower(w) == "u": del word[a] a += a return word
Steven Parker215,984 Points
The unexpected "input" causes the EOF. Since the word to be processed will be passed in to the function as the argument, you won't need to "input" anything.
Some other things you might need to consider:
- strings have a "lower" method, but there's no stand-alone "lower" function
- strings are immutable, so you can't delete just part of a string
- adding a number to itself creates a geometric progression instead of a linear one
- be careful not to change the case of the letters in the string that will not be removed