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

Robert Young
Robert Young
1,391 Points

tried to make a disevowel script, seems to work but wont print to screen

word = input("Give me a word to disemvowel\n> ") vowels = ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', '0']

def disemvowel(word): if letter not in vowels: word.remove(letter) print("Here is your disemvoweled word {}".format(word))

1 Answer

Steven Parker
Steven Parker
231,269 Points

You probably don't need to print anything.

You didn't say, but I'm guessing this is for a code challenge? I'll bet the challenge asked for a function that would return a value, not print one.

Also, always follow the instructions carefully. If I recall correctly, the challenge wants just the string back with the vowels removed. If you use "format" to add another string to it, the challenge will consider the output to be in error.

And when posting code, be sure to format it so the spacing can be seen (in Python, spacing is critical!). So be sure to use the instructions found in the Markdown Cheatsheet down below the "Add an Answer" area of this page. :arrow_heading_down: