On Sunday, December 22, 2013 4:54:46 PM UTC-6, dec...@msn.com wrote:
> basically what I wanna do is this :
> x = 4
> 
> y = 7
> def switch (z,w):
> ***this will switch z to w and vice verca***
>      c= z
>      z=w
>      w=c
>      print 'Now x =', w, 'and y = ' , z
>      return w
> x = switch(x,y)

If your intent is to swap the values of two variables (which
is really rebinding the names only) then why do you need a
function at all when you could explicitly swap the values
yourself? What gain would a function give you -- even if you
could do it?
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to