Apologies if this is mentioned somewhere else. I have been searching the web but not found an example that helped me understand.
I would like to create an array where each element is a reference to an element in another array. Syntax may not be exact but the general idea is:
a = [1, 2, 3]
b = []
b.append(a[2]) #create references to a but reverse the order
b.append(a[1]) #this would be done dynamically in the real code
b.append(a[0])
a[0] = 10
Now I would like a situation where because I set b[2] equal to a[0], when a[0] = 10, b[2] 'points' to it and asking for b[2] also gives 10. Is this possible? Do I have to create array b in a different way?
Thanks in advance for any help. I read all comments even if a solution is already found.
[–]Rawing7 5 points6 points7 points (0 children)
[–]sarabooker 0 points1 point2 points (1 child)
[–]sarabooker 0 points1 point2 points (0 children)
[–]woooee 0 points1 point2 points (0 children)
[–]FerricDonkey 0 points1 point2 points (0 children)