On 10/23/2015 05:19 AM, jarod_v6--- via Tutor wrote:
Hi!!I would like to prepare a dictionary with complex structure:
complex = {name ="value",surname="po",age=poi)
What is the most pythonic way to build a dictionary of dictionary?thanks
for any help!
This doesn't look too complex so I am probably missing something.
The normal dictionary construction would look something like this:
mydict = dict('name'='value', 'surname'='po','age'='poi')
Then you can access any given item in mydict with the get method:
mydict.get('name')
SDG,
tom
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor