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 trialVINAY RAVISHANKAR
Courses Plus Student 4,015 PointsFunction does not returning any value
I'm just trying to get the value from function "disemvowel", but this function does not returning any value.
can you please check this
word=list(input('Enter your word'))
vowels=["a","e","i","o","u"]
def disemvowel(word):
for x in word:
if x in vowels:
word.remove(x)
print(word)
return word
disemvowel(word)
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! It actually does return a value (though it might not be what you want). The problem is that you call the function and pass it whatever you input, but then you don't do anything with the value it returns. It sort of just disappears out into limbo. On your last line, try this:
print(disemvowel(word))
Also, I'm assuming you're running this either in workspaces or your local system as this will likely not be testable inside the challenge.
Hope this helps!
Joel Sprunger
5,448 PointsYou could execute by using the following...
no_vowels = disemvowel(word) print("The word {}, has no vowels.".format(no_vowels))