On Sat, Jul 24, 2010 at 10:09 AM, anuj abhishek <[email protected]>wrote:
> I am not very sure about what you are asking for..
> But, if it's just a dictionary that you want from the given list then I
> beleive
> the folloeing will work..
> >>> x=[['cat',30],['cat',40],['cat',10],['dog',5],['dog',7],['dog',1]]
> >>> x= sorted(x)
> >>> xdictstart=dict(zip([x[0][0],x[3][0]],[x[0][1],x[3][1]]))
> >>> xdictstart
> {'dog': 1, 'cat': 10}
> And similarly for dictend..
> Regards,
> Anuj
>
Thank you for posting. Please try to trim the message backlog
when replying. In your email, your reply was like 10% and the
long tail made up 90% of the rest. It just adds up to the noise.
--Anand
_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers