python - defaultdict tuple of lists -


I will look the default, but I want to verify it in 2-to-TVL lists automatically and I'm not sure it's possible. So what do I need:

  foo = defaultdict (???) foo ['key1'] [0] .append ('value') foo ['key1'] [1]. Append ('other value')   

Is it enabled with default-date?

Of course you should give the default function that gives you what you want the default; The easiest way to create such a closed function is lambda:

  foo = defaultdict (lambda: ([], [])) foo ['key1'] [0] .Append ('Value')    

Comments

Popular posts from this blog

c++ - 'std::string' has no member named 'get' list[i]=user.get; -

sonata admin - how to add ManyToOne property field in configureListfield in sonataAdmin -

python - how we can use ajax() in views.py in django? -