You've got a basic idea of how references work but you're getting confused. When you call the statement variables[0] = data[0]
instead of reassigning what x
points to you reassign what variables[0]
points to. That's why "it does not work."
Here:
x = 0
y = x
y = 4
which is at the heart of what you're attempting to do. If you type this into the REPL you'll see that x
still equates to 0, not 4.