[BangPypers] Hi all

Prashanth Ellina prashanthellina at gmail.com
Mon Jun 9 13:28:10 CEST 2008


*l=['name','jhon', 'age','30']*

print dict([(l[i], l[i+1]) for i in xrange(0, len(l), 2)])


On Mon, Jun 9, 2008 at 4:44 PM, Pratap <pratap.iiit at gmail.com> wrote:

> *I'm fairly new to Python, and have yet to discover all the little details, that may make my programs look leaner and perhaps become  faster...
> I was trying to do a lots of thing and one of them is here which is as
>
> i have a list lists=['name','jhon', 'age','30']
> and i want to make a string which is like
> string="x['name']='jhon' and x['age']=30"
>
> so is it possible in python ? **
> *
>
>
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
>


-- 
http://blog.prashanthellina.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20080609/944884b3/attachment.htm>


More information about the BangPypers mailing list