On Jan 10, 6:52 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of Fredrik Lundh
> > Sent: Wednesday, January 09, 2008 2:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: problem of converting a list to dict
>
> > [EMAIL PROTECTED] wrote:
>
> > >> to see what's going on on your machine, try printing "a" after the
> > >> split, but before you use it to populate the dictionary.
>
> > > 'print a' works
>
> > so what does it tell you?
>
> A bigger hint:
>         a=i.split('=')
>         print "'%s' splits into " % (i), a

consider:
(1) using %r instead of '%s'
(2) omitting the redundant space after 'into'
(3) losing the redundant () around i


>         assert len(a) == 2
>         mydict[a[0]]=a[1]

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to