how to find position of dictionary values

Wojtek Walczak gminick at bzt.bzt
Mon Sep 1 06:59:12 EDT 2008


On Mon, 1 Sep 2008 03:51:13 -0700 (PDT), lee wrote:

> i am soory for that keystrokes. can anyone tell me how can i change
> the value of key.
> suppose i have a dictionary
>
> kev =  {'kabir': ['kabir at kabir.com', '1234', 'missuri'], 'shri':
> ['shri at shri.com', '23423', 'india'], 'marsa': ['marsa at marsa.com',
> '2345', 'brazil'], 'sandeep': ['sandeep at sandeep.com', '007',
> 'canada']}

> how can i change the key to something like 'sabir' and 

kev['sabir'] = kev['kabir']
del kev['kabir']

> how can i
> change the values of kabir?

kev['sabir'][0] = 'sabir at sabir.com'

*untested*

-- 
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/



More information about the Python-list mailing list