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 trialSkyler Slotten
2,925 PointsNot getting it
i can not figure out how to pull each individual teacher and there classes, even after staring at it for a day or two
def most_classes(teachers):
counts = []
max_classes = 0
for key in teachers:
counts.append(len(teachers[key]))
for value in counts:
if value > max_classes:
max_classes = value
for key in teachers:
if max_classes == len(teachers[key]):
return key
def num_teachers(teach_dict):
teach_count = 0
for name in teach_dict:
teach_count += 1
return teach_count
def stats(teachers):
total_stats = []
for teacher in teachers:
total_stats.append( [teacher, len(teachers[teacher])] )
return total_stats
def courses(teachers):
course = []
return course
1 Answer
Kenneth Love
Treehouse Guest TeacherWhat type of data is teachers
? Do you know a way to get only the values of that type of data? What type of data are those values? Do you know how to combine that type of data into a single piece?