After thinking a while this concept came to my mind which I was gone through few days ago.
In Python if I did x=y then automatically x and y will point same object reference location but is there any way I can manage to change y reference location but with same value if x.
for example:
x=100
y=x
now x and y share same object reference location of value 100 but I want to have a different location for y.
Edit: What I am trying to do
l1=[1,2,3,4]
l2=l1
i=0
j=len(l1)-1
while j >= 0 :
l1[i]=l2[j]
i=i+1
j=j-1
print("L1=",l1,"L2",l2,"i=",i,"j=",j)
What I am getting as outout
L1= [4, 2, 3, 4] L2 [4, 2, 3, 4] i= 1 j= 2
L1= [4, 3, 3, 4] L2 [4, 3, 3, 4] i= 2 j= 1
L1= [4, 3, 3, 4] L2 [4, 3, 3, 4] i= 3 j= 0
L1= [4, 3, 3, 4] L2 [4, 3, 3, 4] i= 4 j= -1
Thank you.