Alexandru Palade wrote:
> lookfor = 'dfsdf'
> for item, value in kev.items():
>if lookfor in value:
>print item
>print value.index(lookfor)
>break # assuming you only want one result
slight variation:
lookfor = 'dfsdf'
for item, value i
lee a écrit :
On Sep 1, 2:37 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
lee wrote:
(snip)
i agree with u, my data strusture is not efficient. but all the
records,viz...name,phno, email,address are all generated at runtime ,
when the user enters them. so how can i design my datastructur
On Sep 1, 3:59 pm, Wojtek Walczak <[EMAIL PROTECTED]> wrote:
> 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': ['[EMAIL PROTECTED]', '1234', 'miss
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': ['[EMAIL PROTECTED]', '1234', 'missuri'], 'shri':
> ['[EMAIL PROTECTED]', '23423', 'india'], 'marsa': ['[
On Sep 1, 2:37 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> lee wrote:
> > On Sep 1, 1:45 pm, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote:
> >> lee a écrit :
>
> >> > hi,
> >> > i have a dictionary as follows :
> >> > kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg',
> >> >
lee wrote:
> On Sep 1, 1:45 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
>> lee a écrit :
>>
>> > hi,
>> > i have a dictionary as follows :
>> > kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg',
>> > 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'],
>> > 'addres
lee a écrit :
hi, thank u your solution is exactly wat i wanted :)
I'm afraid it's not what you actually *need*, cf my other post.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 1, 1:45 pm, Bruno Desthuilliers wrote:
> lee a écrit :
>
> > hi,
> > i have a dictionary as follows :
> > kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg',
> > 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'],
> > 'address': ['sdg', 'dsgsdg', 'sdf', 'dfg']}
>
>
On Sep 1, 1:45 pm, Bruno Desthuilliers wrote:
> lee a écrit :
>
> > hi,
> > i have a dictionary as follows :
> > kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg',
> > 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'],
> > 'address': ['sdg', 'dsgsdg', 'sdf', 'dfg']}
>
>
On Sep 1, 1:45 pm, Bruno Desthuilliers wrote:
> lee a écrit :
>
> > hi,
> > i have a dictionary as follows :
> > kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg',
> > 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'],
> > 'address': ['sdg', 'dsgsdg', 'sdf', 'dfg']}
>
>
On Sep 1, 1:45 pm, Bruno Desthuilliers wrote:
> lee a écrit :
>
> > hi,
> > i have a dictionary as follows :
> > kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg',
> > 'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'],
> > 'address': ['sdg', 'dsgsdg', 'sdf', 'dfg']}
>
>
lee a écrit :
hi,
i have a dictionary as follows :
kev : {'phno': ['dgsd', 'gsdg', 'dfsdf', 'g'], 'email': ['dg',
'sgsd', 'sdfsdf', 'gdf'], 'name': ['ds', 'dsg', 'dsfds', 'fgdf'],
'address': ['sdg', 'dsgsdg', 'sdf', 'dfg']}
if user is enters the 3rd item of key phno,
ie "dfsdf" in my dict,
how
On Sep 1, 1:21 pm, Alexandru Palade
<[EMAIL PROTECTED]> wrote:
> lookfor = 'dfsdf'
> for item, value in kev.items():
> if lookfor in value:
> print item
> print value.index(lookfor)
> break # assuming you only want one result
>
> You can als
lookfor = 'dfsdf'
for item, value in kev.items():
if lookfor in value:
print item
print value.index(lookfor)
break # assuming you only want one result
You can also skip the 'if' verification in which case you need to catch
ValueError exceptio
14 matches
Mail list logo