Re: alternating string replace

2008-01-09 Thread Gordon C
This is very cool stuff but I suspect that the code is unreadable to many readers, including me. Just for fun here is a complete program, written in Turbo Pascal, circa 1982, that does the job. Readable n'est pas? Program dash; var str: string[80]; n: integer; odd: boolean; begin

Re: Limit Guessing Algorithm

2007-12-03 Thread Gordon C
One of the difficulties of this kind of a problem is that one is looking for a solution to a limited number of data points for which it may be possible to define a function. There can never be a guarantee that the chosen "fit" can be reliably extrapolated. You need to tie a possible solution to

Re: Arrays

2007-11-13 Thread Gordon C
OK Steve, But why do we say "from array import array" and NOT "from math import math"? Why the difference in syntax? Gord "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 13 Nov 2007 11:26:28 -0500, Gor

Re: Arrays

2007-11-13 Thread Gordon C
OK, thanks to all. The key statement is "from array import array" which is not exactly intuitive! Gord "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Bernard wrote: >> On 12 nov, 20:19, "Gordon C" <[EMAIL PROTEC

Arrays

2007-11-12 Thread Gordon C
Absolute newbie here. In spite of the Python Software Foundation tutorial's ( http://www.python.org/doc/current/tut/tut.html ) use of the array declaration array(type[,initializer]), the Python interpreter does NOT accept the word array! It , presumably, needs to have an import included. Coul