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 Python Collections (Retired) Dictionaries Membership

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Need to check what it takes to pass?

So, while working on this challenge I wrote something incorrectly in my code and the error I got was "Bummer! Expected 2, got 6". So I figured I would run a little test to see if that is all it was checking. So...

# THIS IS A TEST OF THE CHALLENGE
# As of 9:12 pm PDT, 10/16/2014
# It passes the challenge, but it is not what you want to do.
#

def members (dict, list):
     return 2

Perhaps Kenneth Love can have someone take a look.

Ken

Hi Ken,

I got the same error until I realized the problem is asking how many keys in the list are also in the dictionary.

Ken Alger
Ken Alger
Treehouse Teacher

Robert;

Thanks for the update. I solved the challenge a while back and was revisiting it tonight and thought I would do the test which I posted. Like I said, it gets you through the challenge, but I'm quite certain it is not useful, educational code, nor the intended way in which Mr. Love designed the challenge to function.

Ken

1 Answer

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

I should probably add some AST validation to the challenge, yes. Ultimately, though, it becomes a balancing act between forcing you to write code that matches my ideals and just making sure you gave me the right answer.

Ken Alger
Ken Alger
Treehouse Teacher

Mr. Love;

No worries, just wanted to make sure that it wasn't a bug in the system or something.

Keep up the great work and thanks for all you do.

Ken