Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'convention,': 0.09; 'encode': 0.09; 'seen,': 0.09; 'python': 0.11; 'def': 0.12; 'wrote': 0.14; "(it's": 0.16; 'above?': 0.16; 'charles': 0.16; 'iirc': 0.16; 'lisp': 0.16; 'message-id:@earthlink.net': 0.16; 'received:dsl.mindspring.com': 0.16; 'language': 0.16; 'wrote:': 0.18; 'examples': 0.20; 'header:User-Agent:1': 0.23; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'tim': 0.29; "i'm": 0.30; '-0700,': 0.31; 'comments,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'subject:numbers': 0.31; 'know.': 0.32; 'could': 0.34; 'but': 0.35; 'scheme': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; '2013': 0.98 Date: Wed, 16 Oct 2013 12:18:39 -0700 From: Charles Hixson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9 MIME-Version: 1.0 To: python-list@python.org Subject: Re: converting letters to numbers References: <26151b64-4f5e-4ee9-81ac-26679932f43d@googlegroups.com> <525b7aec$0$30000$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <525b7aec$0$30000$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381951191 news.xs4all.nl 15877 [2001:888:2000:d::a6]:49247 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56894 On 10/13/2013 10:02 PM, 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? > > > IIRC Lisp uses % for comments, but it may need to be doubled. (It's been doubled in the examples I've seen, and I don't remember the syntax.) Perhaps Scheme has the same convention, but Scheme could be considered a part of the Lisp clade. -- Charles Hixson