converting letters to numbers

Oscar Benjamin oscar.j.benjamin at gmail.com
Wed Oct 16 20:21:49 EDT 2013


On Oct 16, 2013 11:54 PM, "MRAB" <python at mrabarnett.plus.com> wrote:
>
> On 16/10/2013 23:39, Rotwang wrote:
>>
>> On 14/10/2013 06:02, Steven D'Aprano wrote:
>>>
>>> On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote:
>>>
>>>> def add(c1, c2):
>>>>       % Decode
>>>>       c1 = ord(c1) - 65
>>>>       c2 = ord(c2) - 65
>>>>       % Process
>>>>       i1 = (c1 + c2) % 26
>>>>       % Encode
>>>>       return chr(i1+65)
>>>
>>>
>>> Python uses # for comments, not %, as I'm sure you know. What language
>>> were you thinking off when you wrote the above?
>>
>>
>> Maybe TeX?
>>
> Or PostScript?

My money's on matlab.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20131017/a1a9ace4/attachment.html>


More information about the Python-list mailing list