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 - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -