help wanted with list

Iuri iurisilvio at gmail.com
Thu Sep 24 16:38:35 EDT 2009


You should use a dictionary.
dic = {'a':1, 'b':2}

Use dic['a'] to get output 1.

[]s
iurisilvio



On Thu, Sep 24, 2009 at 5:31 PM, Ahmed Shamim <partha.shamim at gmail.com>wrote:

> list = [ 'a', '1', 'b', '2']
> what would be the logic, if I input a to get output 1.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090924/888a404f/attachment.html>


More information about the Python-list mailing list