Weird behavior in search in a list

2007-03-29 Thread Su Y
hi all, I can't understand how this code work, its behavior is really weird for me... I want find the first number in extend[] which is larger than num, so I wrote: def find(num): count=0 for elem in extend: if elem-- http://mail.python.org/mailman/listinfo/python-list

Re: Weird behavior in search in a list

2007-03-29 Thread Su Y
On 3月29日, 下午7时51分, "Su Y" <[EMAIL PROTECTED]> wrote: > hi all, > I can't understand how this code work, its behavior is really weird > for me... > > I want find the first number in extend[] which is larger than num, soI wrote: > > def find(num): > c

Re: Weird behavior in search in a list

2007-03-29 Thread Su Y
On 3月29日, 下午8时22分, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Mar 29, 2007, at 6:51 AM, Su Y wrote: > > > > > > > I want find the first number in extend[] which is larger than num, so > > I wrote: > > def find(num): > > count=0