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
Post a Comment