Supoose I have a python list a = [0,1,2,3,4,5]
. now I neeed to make a list b
such that b
should contain elements [1,2,3]
, but as a reference to a
. By this I mean that if I change a[1] = 3
then b[0]
should alsoe be 3
. How shall I achieve this?
from what I know, with b = a
I can have copy by reference, but only possible with full list, and if I do b = a[1:4]
, then its a seperate copy.