how to get the ordinal number in list

Chris Angelico rosuav at gmail.com
Mon Aug 11 05:15:48 EDT 2014


On Mon, Aug 11, 2014 at 6:55 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> On Sun, 10 Aug 2014 23:22:45 -0700, Rustom Mody wrote:
>
>> You think that the '=' sign not standing for math equality is ok.
>>
>> How come?
>
> For the same reason that in the following:
>
> [c.upper() for c in some_string if 'a' < c < 'x']
>
> having the c symbol not stand for the speed of light is okay. Likewise,
> in the sentence "I went to the park today", the symbol I doesn't mean the
> element iodine. Symbols are context-dependent: the x in one equation is
> not necessarily the same x in another equation, and the symbol = in one
> context does not necessarily have the same meaning as in another context.

Thanks, you said it better than I would have. That's exactly the
sentiment I would have expressed, and while I hate to "Me too" a post,
I'll do it here. +1.

ChrisA



More information about the Python-list mailing list