I am using Python 3. Suppose I have 2 variables and create a list containing the 2 variables
a = 48
b = 42
arr = [a, b]
If I modify a then arr remains the same, this is because a is an integer, if it was an object, then the object in arr (that is technically a reference to the same object) gets updated. I want arr[0] to be a reference to the variable a rather than the value itself, so that if a is changed then arr[0] is changed as well. How do I do that?
a" There is no such thing in Python. Can you clarify what behaviour you want? Areaandbfunction locals or globals? Do you always need a list of "variable references", or also independent references? Do you needaandarrto appear "normal", or is a wrapping helper object acceptable?aandbare globals, and I want them to appear normal @MisterMiyagi