Re: palindrome iteration

2010-08-27 Thread Richard Arts
> Now there is another solution. A palindrom is made of two symetric halves, > with (odd len) or without (even len) a single char between the symetric > halves, ie : > > * odd : ABCBA ('AB' + 'C' + 'BA') > * even : ABCCBA ('ABC' + 'CBA') > > So you just have to extract the symetric halves, reverse

Re: palindrome iteration

2010-08-27 Thread Richard Arts
On Fri, Aug 27, 2010 at 10:51 PM, Jussi Piitulainen wrote: > MRAB writes: >> On 27/08/2010 20:43, Jussi Piitulainen wrote: >>> Dave Angel writes: Jussi Piitulainen wrote: > Agreed. But is there any nicer way to spell .reverse than [::-1] > in Python? There is .swapcase() but no .rever

Re: palindrome iteration

2010-08-27 Thread Richard Arts
On Fri, Aug 27, 2010 at 11:47 PM, Richard Arts wrote: > On Fri, Aug 27, 2010 at 10:51 PM, Jussi Piitulainen > wrote: >> MRAB writes: >>> On 27/08/2010 20:43, Jussi Piitulainen wrote: >>>> Dave Angel writes: >>>>> Jussi Piitulainen wrote: &g

Re: MySQL Problem

2010-09-03 Thread Richard Arts
These are also mere suggestions. The statements you use in your print statement and the one you use to feed the cursor differ slightly. The latter is missing quotes around your search criterium. Isn't it possible to fetch results row by row and see if the missing row is in the set? That way you c