Re: [Tutor] Manipulating Dictionary values

2016-12-26 Thread Sunil Tech
Thank you Steven D'Aprano and Alan Gauld. On Mon, Dec 26, 2016 at 4:41 PM, Alan Gauld via Tutor wrote: > On 26/12/16 08:03, Sunil Tech wrote: > > Hi Team, > > > > Dictionary is like > > > > a = {'a': 'New', 'b': 'Two', 'l': [{'k': 'test', 'm': 'again'}, {'k': > > 'test', 'm': 'again'}]} > > > >

Re: [Tutor] Manipulating Dictionary values

2016-12-26 Thread Alan Gauld via Tutor
On 26/12/16 08:03, Sunil Tech wrote: > Hi Team, > > Dictionary is like > > a = {'a': 'New', 'b': 'Two', 'l': [{'k': 'test', 'm': 'again'}, {'k': > 'test', 'm': 'again'}]} > > I am trying to modify a value in the dictionary value at a['l'] So make life easy for yourself and get rid of the outer

Re: [Tutor] Manipulating Dictionary values

2016-12-26 Thread Steven D'Aprano
On Mon, Dec 26, 2016 at 01:33:37PM +0530, Sunil Tech wrote: > Hi Team, > > Dictionary is like > > a = {'a': 'New', 'b': 'Two', 'l': [{'k': 'test', 'm': 'again'}, {'k': > 'test', 'm': 'again'}]} > > I am trying to modify a value in the dictionary value at a['l'] & at 'm' > expecting it to be > >

Re: [Tutor] Manipulating Dictionary values

2016-12-26 Thread Steven D'Aprano
On Mon, Dec 26, 2016 at 02:15:59PM +0530, Sunil Tech wrote: > ​​ > Can this be achievable in one liner? Why? Can you only fit one more line of code before your hard drive is full? -- Steve ___ Tutor maillist - Tutor@python.org To unsubscribe or ch

Re: [Tutor] Manipulating Dictionary values

2016-12-26 Thread Sunil Tech
​​ Can this be achievable in one liner? On Mon, Dec 26, 2016 at 1:33 PM, Sunil Tech wrote: > > Hi Team, > > Dictionary is like > > a = {'a': 'New', 'b': 'Two', 'l': [{'k': 'test', 'm': 'again'}, {'k': 'test', 'm': 'again'}]} > > I am trying to modify a value in the dictionary value at a['l'] & at

[Tutor] Manipulating Dictionary values

2016-12-26 Thread Sunil Tech
Hi Team, Dictionary is like a = {'a': 'New', 'b': 'Two', 'l': [{'k': 'test', 'm': 'again'}, {'k': 'test', 'm': 'again'}]} I am trying to modify a value in the dictionary value at a['l'] & at 'm' expecting it to be a = {'a': 'New', 'b': 'Two', 'l': [{'k': 'test', 'm': 'replaced'}, {'k': 'test',