Re: [Tutor] Create complex dictionary :p: :p:

2015-10-22 Thread Thomas C. Hicks
On 10/23/2015 05:59 AM, Alex Kleider wrote: mydict = dict('name'='value', 'surname'='po','age'='poi') Oops, you are correct! Don't want to put the key names in quotes, I mistyped my experiment. SDG, tom ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] Create complex dictionary

2015-10-22 Thread Ben Finney
jarod_v6--- via Tutor writes: > Hi!!I would like to prepare a dictionary with complex structure: > > complex = {name ="value",surname="po",age=poi) That's invalid syntax (the braces don't match) and it seems to use names from elsewhere. If you mean a dictionary like this:: wibble = {'name'

Re: [Tutor] Create complex dictionary

2015-10-22 Thread Cameron Simpson
On 22Oct2015 23:19, 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

Re: [Tutor] Create complex dictionary :p:

2015-10-22 Thread Alex Kleider
On 2015-10-22 14:50, Thomas C. Hicks wrote: 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

Re: [Tutor] Create complex dictionary :p:

2015-10-22 Thread Thomas C. Hicks
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