How can i return more than one value from a function to more than one variable

dec135 at dec135 at
Sun Dec 22 23:54:46 CET 2013

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
     print 'Now x =', w, 'and y = ' , z
     return w
x = switch(x,y)

 How am I supposed to do so I can  return also a value to the variable y WITHOUT printing 'Now x =', w, 'and y = ' , z   a second time ?

thanks in advance

More information about the Python-list mailing list