swap function?

Andy Smith ams70 at cam.ac.uk
Thu Nov 16 01:44:15 CET 2000

Bob van der Poel <bvdpoel at uniserve.com> writes:

> I'm sure I'm just being very dumb today...but I was looking for a swap
> function and can't seem to find anything. I really don't need to do:
> 	temp=a
> 	b=a
> 	a=temp
> everytime I need this do I????

Try a,b = b,a.

Andy Smith                                             ams70 at cam.ac.uk
St John's College, Cambridge, CB2 1TP, UK               (07989) 453208

More information about the Python-list mailing list