Re: [Tutor] Swapping variables ...

2007-11-11 Thread wesley chun
On 11/10/07, O.R.Senthil Kumaran <[EMAIL PROTECTED]> wrote: > > After quizzing newbies in C on swapping without 3rd variable, I found this > > to be really *cool* construct to swap :) > > x = 10 > > y = 20 > > x,y = y,x > > Keep in mind that, this is actually a tuple assignment. > A new tuple x,y

Re: [Tutor] Swapping variables ...

2007-11-10 Thread O.R.Senthil Kumaran
> After quizzing newbies in C on swapping without 3rd variable, I found this > to be really *cool* construct to swap :) > x = 10 > y = 20 > x,y = y,x > Keep in mind that, this is actually a tuple assignment. A new tuple x,y is created with the older one y,x, and with the side effect thatthe var

[Tutor] Swapping variables ...

2007-11-09 Thread Aditya Lal
After quizzing newbies in C on swapping without 3rd variable, I found this to be really *cool* construct to swap :) x = 10 y = 20 x,y = y,x -- Aditya ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor