<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>A mi o me engañaron como un niño, o todos los que dicen que en python el paso es por referencia versean, pero el siguiente ejemplo muestra que depende del tipo de argumento...</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">In [2]: def f(x,y):<br> ...: x=x+3<br> ...: y.append(23)<br> ...: print x, y<br> ...: <br><br>In [3]: x=22<br><br>In [4]: y=[22]<br><br>In [5]: f(x,y)<br>25 [22, 23]<br><br>In [6]: print x,y<br>22 [22, 23]<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color:
transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">En (5) se ve que se modificaron los contenidos en la instancia de la función, pero fuera de ella (6), solo la lista se ve afectada, entonces, que quedamos?? alguien me lo puede aclarar... </div></div></body></html>