How do I exchange the values of A and B

Mike Fletcher mfletch at tpresence.com
Tue Nov 21 01:26:31 EST 2000


a = 2
b = 3
a,b = b,a

And that's Python :o) . HTH,
Mike

-----Original Message-----
From: Peter Hansen [mailto:peter at engcorp.com]
Sent: Monday, November 20, 2000 11:56 PM
To: python-list at python.org
Subject: Re: How do I exchange the values of A and B


Charlie Kilmer wrote:
> 
> How do I exchange the values
> int A = x;
> int B= y;
> 
> here x and y are the values
> 
> how do exchange the values so that
> int A = y;
> int B = x;

Umm, in what language?  'Cause that ain't Python...
-- 
http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list