On Sun, 20 Nov 2005 07:12:08 -0800, Shi Mu <[EMAIL PROTECTED]> wrote:
>d is a dictionary.
d
>{0: [[0, 1], [0, 2]], 1: [[0, 1], [1, 2], [1, 3]], 2: [[0, 2], [1, 2],
>[2, 3]], 3: [[1, 3], [2, 3]]}
>
>for the value under each key, if the possible connection is in the
>dictionary, for example, un
Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci
news:[EMAIL PROTECTED]
On 11/20/05, przemek drochomirecki <[EMAIL PROTECTED]> wrote:
>
> Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci
> news:[EMAIL PROTECTED]
> > Shi Mu wrote:
> >
> > > how to do with it?
> >
> > Us
On 11/20/05, przemek drochomirecki <[EMAIL PROTECTED]> wrote:
>
> Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci
> news:[EMAIL PROTECTED]
> > Shi Mu wrote:
> >
> > > how to do with it?
> >
> > Use Ben Finney's, not Przemek's approach if the values are mutables that
> you
> > plan
Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci
news:[EMAIL PROTECTED]
> Shi Mu wrote:
>
> > how to do with it?
>
> Use Ben Finney's, not Przemek's approach if the values are mutables that
you
> plan to modify. If that's what you are asking.
>
> Peter
Maybe he just want to use d
Shi Mu wrote:
> how to do with it?
Use Ben Finney's, not Przemek's approach if the values are mutables that you
plan to modify. If that's what you are asking.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
On 11/20/05, Peter Otten <[EMAIL PROTECTED]> wrote:
> przemek drochomirecki wrote:
>
> > Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci
> > news:[EMAIL PROTECTED]
> > I have have the following code:
> a=[3,5,8,0]
> b={}
>
> > How I can i assign each item in a as the key
przemek drochomirecki wrote:
> Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci
> news:[EMAIL PROTECTED]
> I have have the following code:
a=[3,5,8,0]
b={}
> How I can i assign each item in a as the key in the dictionary b
> simultaneously?
> that is,
> b={3:[],5:[],8:[]
Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci
news:[EMAIL PROTECTED]
I have have the following code:
>>> a=[3,5,8,0]
>>> b={}
>>>
How I can i assign each item in a as the key in the dictionary b
simultaneously?
that is,
b={3:[],5:[],8:[],0:[]}
Thanks!
Other solution:
b.fromkeys(a,
Shi Mu <[EMAIL PROTECTED]> wrote:
> I have have the following code:
> >>> a=[3,5,8,0]
> >>> b={}
> >>>
> How I can i assign each item in a as the key in the dictionary b
> simultaneously?
> that is,
> b={3:[],5:[],8:[],0:[]}
Explicit:
a = [3, 5, 8, 0]
b = {}
for key in a:
b[ke
On 20 Nov 2005 02:59:30 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> b = dict([(x,dict()) for x in a])
> Shi Mu wrote:
> > I have have the following code:
> > >>> a=[3,5,8,0]
> > >>> b={}
> > >>>
> > How I can i assign each item in a as the key in the dictionary b
> > simultaneously?
> > t
b = dict([(x,dict()) for x in a])
Shi Mu wrote:
> I have have the following code:
> >>> a=[3,5,8,0]
> >>> b={}
> >>>
> How I can i assign each item in a as the key in the dictionary b
> simultaneously?
> that is,
> b={3:[],5:[],8:[],0:[]}
> Thanks!
--
http://mail.python.org/mailman/listinfo/pytho
11 matches
Mail list logo