Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '16,': 0.03; 'encode': 0.09; 'python': 0.11; 'def': 0.12; 'wrote': 0.14; '>>': 0.16; 'above?': 0.16; 'language': 0.16; 'wrote:': 0.18; '>>>': 0.22; '>>>': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'tim': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '-0700,': 0.31; '>>>>': 0.31; 'comments,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'subject:numbers': 0.31; 'know.': 0.32; 'maybe': 0.34; 'received:google.com': 0.35; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RB246d++wd6k7logeVgNEWc9h6APvmF7roCwXNpzXe0=; b=Z3wunjEz67xvRXIi+vfAxxv2Cr0tJGSDTXmAfHQpkLz0liEIIHnRvn+zOCaPLejQO5 G13KPAVUTSLw3enC2aQeJKJfEG8uQYoiokQ3GSF8dS9ARMQ/TAkMQtJa6odeJy85iNLx WuCsFuVeD5yT5vdU12jhRsbWITyCX+gs1pMBxedsewSOvXZfFuL9O+z/22npw5sAD1HH c+9aKdzkAhwfTSyVoe6G4x20WRordSS3dj++OWMIyN7OgUsrjgvaRsVQ0nkkvuW52yls jY+oXhdWE8fZmD/6iMRTjYPJJYJQuO6zLHEz4RDWqI0SreTPYL1Zpzb+Hkem2HxqP8PY 7LVg== MIME-Version: 1.0 X-Received: by 10.220.186.202 with SMTP id ct10mr4709988vcb.14.1381969309935; Wed, 16 Oct 2013 17:21:49 -0700 (PDT) In-Reply-To: <525F18CE.4080606@mrabarnett.plus.com> References: <26151b64-4f5e-4ee9-81ac-26679932f43d@googlegroups.com> <525b7aec$0$30000$c3e8da3$5496439d@news.astraweb.com> <525F18CE.4080606@mrabarnett.plus.com> Date: Thu, 17 Oct 2013 01:21:49 +0100 Subject: Re: converting letters to numbers From: Oscar Benjamin To: python-list@python.org Content-Type: multipart/alternative; boundary=047d7b676fd0cf337204e8e4cdfa X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 67 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381969640 news.xs4all.nl 15958 [2001:888:2000:d::a6]:37010 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56915 --047d7b676fd0cf337204e8e4cdfa Content-Type: text/plain; charset=ISO-8859-1 On Oct 16, 2013 11:54 PM, "MRAB" 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. --047d7b676fd0cf337204e8e4cdfa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Oct 16, 2013 11:54 PM, "MRAB" <python@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):
>>>> =A0 =A0 =A0 % Decode
>>>> =A0 =A0 =A0 c1 =3D ord(c1) - 65
>>>> =A0 =A0 =A0 c2 =3D ord(c2) - 65
>>>> =A0 =A0 =A0 % Process
>>>> =A0 =A0 =A0 i1 =3D (c1 + c2) % 26
>>>> =A0 =A0 =A0 % Encode
>>>> =A0 =A0 =A0 return chr(i1+65)
>>>
>>>
>>> Python uses # for comments, not %, as I'm sure you know. W= hat language
>>> were you thinking off when you wrote the above?
>>
>>
>> Maybe TeX?
>>
> Or PostScript?

My money's on matlab.

--047d7b676fd0cf337204e8e4cdfa--