Q:

Count elements of in a multiple nested dictionary

I have a dict
dt = {'condition': ['isabs', 'isdir', 'isfile', 'islink', 'ismount'],
 'expand': ['expanduser', 'expandvars'],
 'get': ['getatime', 'getctime', 'getmtime', 'getsize']}

to count its elements.
I define a function
def count_nested_list(dt):
    i = 0
    for value in dt.values():
        for j in value:
            i += 1
    return i

alternatively can use len(dt(0) + len(dt1) + len(dt2)
How to solve the problem in one line?

A:

This should do it:
sum(len(v) for v in dt.values())

