Label point with list value

As some people here probably know, you can make a label that shows the value of a variable in real time by using ${variable name} in the label. I am trying to find a way to make it so I can get a value at a list index and put it in the label. For example:

p_1 = (0,0)

L = [5,3,2,7]

Label: ${L[1]}

p_1 should be labeled with 5 in this case. Any idea how I could achieve this?

You can define a variable which is defined as L[1] and then call that variable in the label field. Here’s an example with your point, p_1, and list, L.

Actually, I’ve found something that works. I don’t know why this wasn’t working before. Thanks anyways.