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
> 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
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