Re: [Tutor] Question on joining out of order dictionary elements

2007-01-11 Thread Luke Paireepinart
raghu raghu wrote: > > [snip original message] > > > To print or to retain individual values from a list,it has to be > written in the form of > config={'test1':'elem1','test2':'elem2','test3':'elem3'} > config['test4'] = 'elem4' > print config.values() > print config['test1']- To get individual v

Re: [Tutor] Question on joining out of order dictionary elements

2007-01-11 Thread Andrew Robert
I like this solution. Thanks everyone for all of the suggestions. On 1/11/07, Andre Engels <[EMAIL PROTECTED]> wrote: > 2007/1/11, raghu raghu <[EMAIL PROTECTED]>: > > > >>> print "\\".join((config["val2"] > > ,config["val1"],config["val3"])) > > elem2\elem1\elem3 > > > > or > > > > >>> print "%s

Re: [Tutor] Question on joining out of order dictionary elements

2007-01-11 Thread Andre Engels
2007/1/11, raghu raghu <[EMAIL PROTECTED]>: >>> print "\\".join((config["val2"],config["val1"],config["val3"])) elem2\elem1\elem3 or >>> print "%s\\%s\\%s" % (config["val2"],config["val1"],config["val3"]) elem2\elem1\elem3 but this seems somehow uneligent. Are there a more efficient/compact

[Tutor] Question on joining out of order dictionary elements

2007-01-11 Thread raghu raghu
Hi everyone, I have a quick quick question joining out of order dictionary values. For example: I created an empty config={} Added some key/value pairs config["test1"]="elem1" config["test2"]="elem2" config["test3"]="elem3" etc Dumped the values and joined them at the same time.

Re: [Tutor] Question on joining out of order dictionary elements

2007-01-10 Thread John Fouhy
On 11/01/07, Andrew Robert <[EMAIL PROTECTED]> wrote: > Only some of the key/value pairs in the dictionary are needed so a > dump of all values does not work. > > Also, the order in which the values are joined is important so walking > through and joining all values does not work either. Well, a d

[Tutor] Question on joining out of order dictionary elements

2007-01-10 Thread Andrew Robert
Hi everyone, I have a quick quick question joining out of order dictionary values. For example: I created an empty >>> config={} Added some key/value pairs >>> config["test1"]="elem1" >>> config["test2"]="elem2" >>> config["test3"]="elem3" etc >>> Dumped the values and joined them at