Tuesday, 13 August 2013

How does iteration work in function

How does iteration work in function

here's my problem. Sorry for the previous post which was not clear at all.
so here's an example :
import numpy as np
x=np.arange(1,100,1)
y=z=x*0
def func(h,g):
for i in range(1,50):
h[i]=i+1
g[i]=i*2
func(z,y)
print z-y
In this example z and y give the same answer but why is that so? in the
function it is not supose to give the same answer?

No comments:

Post a Comment