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.

When I test out the code on various data sets (dictionaries similar to the example) it works but not for the task answer

The function should accept a dictionary arg in the format of {'teacher1':['courses']...etc and return a list of lists that have the first value as the name and second as the amount of courses Please See the 'stats' function

def stats(arg5): retValue=[] for key,value in arg5.items(): retValue.append([key,len(value)])

```return(retValue)
```
teachers.py
```# 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(arg1):
return1=0
dictA=arg1
for key in dictA:
return1 +=1
continue
return(return1)

def num_courses(arg2):
return2=0
dictA=arg2
for key in dictA:
return2 += len(dictA[key])
continue
return(return2)

def courses(arg3):
return3=[]
dictA=arg3
for key in dictA:
return3.extend(dictA[key])
return(return3)

def most_courses(arg4):
return4=[]
courseLen=0
dictA=arg4
for key in dictA:
if len(dictA[key])>courseLen:
return4=key
courseLen=len(dictA[key])
else:
continue
return(return4)

def stats(arg5):
retValue=[]
for key,value in arg5.items():
retValue.append([key,len(value)])

return(retValue)
```