Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mani Vannan |
I have little confusion here in handling the arrays and dictionaries
I have a example script here:
Var test = {“A”:10, “B”:10}
If I have to change the values of this var I would do something like this
func _on_button_pressed():
test[“A”] += 10
test[“B”] -= 1
If my var looks like this
Var test = [{“A”:10}, {“B”:10}]
If it was a array I would call it with its index like
test[0]
But since it is a array of dictionaries how would i call it in the
Function to change the values according to their index in the array
Like how to call the dictionary containing {“A”:10} by test[0] , {“B”:10} by test[1]
Thank you in advance.