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 (2016, retired 2019) Dictionaries Teacher Stats

Why is this showing error? Please provide solution

Why is this showing error? Please provide solution

def num_teachers(test2):
    return len(test2)
def num_courses(teachers):
    total = 0
    for value in teachers.values():
        # for the number of courses within that value
        for course in value:
            total += 1
    return total
def courses(teachers):
    output = []
    for courses in teachers.values():
        output +=courses

    return output

def num_courses(a_dict):
    a_list = []
    for key in a_dict:
        for item in key:
        if item not in a_list:
            return a_list
def most_courses(teachers):
    all_courses = []
        for value in teachers.values():
        return all_courses