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 Teacher Stats

Sum Tsui
seal-mask
.a{fill-rule:evenodd;}techdegree
Sum Tsui
Full Stack JavaScript Techdegree Student 29,117 Points

what is the answer for the 1st and 2nd challenges in the python collection class?

did anyone ask questions about these two challenges before? how can i see questions related to these two challenges posted by other people? if i get stuck in a challenge, besides hitting that get help button, is there more hints for that challenge i can see?

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,426 Points

Hi Sum Tsui,

Unfortunately, there currently isn't a direct way to see what others have asked about challenge without using to help button. After using the help button, your question is posted with a breadcrumb list of the Topic, Course, Section, and the Challenge shown above your question. These are clickable links:

Python > Python Collections > Dictionaries > Teacher Stats

Clicking on the Teacher Stats brings up all questions asked about that challenge ("code challenge 2242")

The other alternative is to search by the name of the challenge: "Teacher Stats"

For questions on videos, there is a tab below the video showing questions asked about that video.

Here is one what to solve the first two tasks of this challenge:

# task 1
def most_classes(my_dict):
    count = 0
    for teacher, classes in my_dict.items(): 
        if len(classes) > count:
            count = len(classes)
            has_most = teacher
    return has_most
ā€‹
# task 2
def num_teachers(my_dict):
    return len(my_dict)
Josh Keenan
Josh Keenan
20,315 Points

Tip: if you're looking to find answers on the forums, use the challenge name!

That's how most people title their questions and make them easier to find for other people, to answer the question the only other help (without leaving the Treehouse site) is to rewatch the last video, you might suddenly find you know the answers or how to create a piece of code to solve the problem!