finding the number of elements in a defaultdict(list) python
<p>A quick question? I am wondering if there is a pythonic way to get the following.</p>

<p>I have a defaultdict(list)</p>

<pre><code> foo = {"a":[1,2,3], "b":[3]....} and so on.
</code></pre>

<p>Is there a pythonic way to write a function which returns me only the keys whose list have length more than "n"</p>

<p>so for example</p>

<pre><code> def return_keys_based_on_value_length(num,dictionary):
    key_list = []
    for k,v in dictionary:
         if len(v)&gt;= num:
            key_list.append(k)
    return key_list
</code></pre>

<p>is there a pythonic way to do this?
Thanks</p>
