Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python

Eric Kumasaka
Eric Kumasaka
869 Points

My code runs on my win10 laptop using python IDLE but it won't run in the Treehouse workspace.

I'm stuck on the disemvowel.py exercise. My code runs fine on my Surface Pro 6 Win10 pc but I keep getting an error message in the Treehouse workspace.

The error message is:

"X Bummer: Hmm, got back letters I wasn't expecting! Called disemvowel('vuAuPs') and expected 'vPs'. Got back None."

'''def disemvowel.py(word):

   wordlist = list(word)
   vowelslist = ['a','A','e','E','i','I','o','O','u','U']

   for vowel in vowelslist:

        wordlist = [l for l in wordlist if l != vowel]

   word = ''.join(wordlist)

   print(word)

disemvowel("carburator")

3 Answers

You need a return statement instead of print. Why the checker sees none is because your function doesn't return anything.

Andrew Bickham
Andrew Bickham
1,461 Points

so ive been working on the same challenge, and I’ve bedn snooping around the community just to see how others have cleared the challenge, i came across this one and was wondering if someone could explain all the coding after the “for loop”