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

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”