Re: insertion sorts...

2008-06-30 Thread MRAB
On Jun 30, 3:29 pm, python_newbie <[EMAIL PROTECTED]> wrote: > On 25 Haziran, 17:44, MRAB <[EMAIL PROTECTED]> wrote: > > > > > On Jun 25, 11:37 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > > > On 2008-06-25, python_newbie <[EMAIL PROTECTED]> wrote: > > > > > On 24 Haziran, 04:33, Terry Reedy <[

Re: insertion sorts...

2008-06-30 Thread Maric Michaud
Le Monday 30 June 2008 16:29:11 python_newbie, vous avez écrit : > On 25 Haziran, 17:44, MRAB <[EMAIL PROTECTED]> wrote: > > On Jun 25, 11:37 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > > On 2008-06-25, python_newbie <[EMAIL PROTECTED]> wrote: > > > > On 24 Haziran, 04:33, Terry Reedy <[EMAIL

Re: insertion sorts...

2008-06-30 Thread python_newbie
On 25 Haziran, 17:44, MRAB <[EMAIL PROTECTED]> wrote: > On Jun 25, 11:37 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > > > > On 2008-06-25, python_newbie <[EMAIL PROTECTED]> wrote: > > > > On 24 Haziran, 04:33, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > Thanks for all answers. At the end i ve

Re: insertion sorts...

2008-06-25 Thread MRAB
On Jun 25, 11:37 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-06-25, python_newbie <[EMAIL PROTECTED]> wrote: > > > On 24 Haziran, 04:33, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Thanks for all answers. At the end i ve only one point. If a decide to > > copy list to iterate when will i

Re: insertion sorts...

2008-06-25 Thread A.T.Hofkamp
On 2008-06-25, python_newbie <[EMAIL PROTECTED]> wrote: > On 24 Haziran, 04:33, Terry Reedy <[EMAIL PROTECTED]> wrote: > Thanks for all answers. At the end i ve only one point. If a decide to > copy list to iterate when will i have to do this ? Before the > iteration ? And then iterate through one

Re: insertion sorts...

2008-06-25 Thread python_newbie
On 24 Haziran, 04:33, Terry Reedy <[EMAIL PROTECTED]> wrote: > Matimus wrote: > > May I suggest you look into using `enumerate`: > > for i, val in enumerate([4,5,6]): > > ...  print i, val > > ... > > 0 4 > > 1 5 > > 2 6 > > > It allows you to get the index and the value at the same time, whic

Re: insertion sorts...

2008-06-23 Thread Terry Reedy
Matimus wrote: May I suggest you look into using `enumerate`: for i, val in enumerate([4,5,6]): ... print i, val ... 0 4 1 5 2 6 It allows you to get the index and the value at the same time, which should eliminate the need for `aList.index`. I thought of suggesting that, but indirectly

Re: insertion sorts...

2008-06-23 Thread Matimus
On Jun 23, 11:52 am, python_newbie <[EMAIL PROTECTED]> wrote: > I don't know this list is the right place for newbie questions. I try > to implement insertion sort in pyhton. At first code there is no > problem. But the second one ( i code it in the same pattern i think ) > doesn't work. Any ideas

Re: insertion sorts...

2008-06-23 Thread Terry Reedy
python_newbie wrote: I don't know this list is the right place for newbie questions. It is. We get them all the time. There is also a tutor mailing list. > I try to implement insertion sort in pyhton. python > At first code there is no problem. It is pretty straightforward. But the se

insertion sorts...

2008-06-23 Thread python_newbie
I don't know this list is the right place for newbie questions. I try to implement insertion sort in pyhton. At first code there is no problem. But the second one ( i code it in the same pattern i think ) doesn't work. Any ideas ? def in