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 trialDaniel Whiteman
Full Stack JavaScript Techdegree Student 19,248 PointsWhile I have the answer, I don't understand how this has anything to do with a dictionary
Sorry for asking a stupid question here. I have added the correct answer but I don't see how the answer relates to a dictionary in any way? For instance, we haven't used the {} command or even the less convenient dict([["", ""]]) command. What's throwing me is that I'm trying to incorporate a dictionary using what we learned in this section when I a basic function is what's needed. Getting tripped up on the language of the question maybe.
I realize this is all part of learning as I am a newbie. This part of the challenge is just confusing to me so in an effort to understand, I'd love some feedback. Thanks for the help!
# The dictionary will look something like:
# {'Andrew Chalkley': ['jQuery Basics', 'Node.js Basics'],
# 'Kenneth Love': ['Python Basics', 'Python Collections']}
#
# Each key will be a Teacher and the value will be a list of courses.
#
# Your code goes below here.
def num_teachers(arg):
return len(arg)
Daniel Whiteman
Full Stack JavaScript Techdegree Student 19,248 PointsThanks Angel! I'll remember the hint as I move ahead. It was the initial reference to the dictionary that threw me, made me feel like I was missing something. Thanks for the help!
1 Answer
Alex Koumparos
Python Development Techdegree Student 36,887 PointsHi Daniel,
You've probably noticed already but the dictionary becomes very relevant in the later parts of the challenge.
Daniel Whiteman
Full Stack JavaScript Techdegree Student 19,248 PointsThanks Alex! It was the early instructions around it that were initially throwing me. Felt like I was missing something.
angel moreta
2,912 Pointsangel moreta
2,912 Pointshint: remember that your are getting a dictionary as a parameter, they asked you for the total of TEACHERS and also think about the keys() function.