On 22Oct2015 23:19, jarod...@libero.it <jarod...@libero.it> wrote:
Hi!!I would like to prepare a dictionary with complex structure:

complex = {name ="value",surname="po",age=poi)

Well, in Python you'd write the above like this:

 complex = {'name': "value", 'surname': "po", 'age': poi}

What is the most pythonic way to build   a dictionary of dictionary?

Your description is a bit vague, but it sounds like a dictionary or dictionaries is a reasonable way to do it. Example:

 records = {}
 complex = {'name': "value", 'surname': "po", 'age': poi}
 records['key1'] = complex
 complex = {'name': "value2", 'surname': "xy", 'age': poi2}
 records['key2'] = complex

Nothing wrong with that if it fits what you actually need to do.

Cheers,
Cameron Simpson <c...@zip.com.au>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to