Getting values from 3d arrays in python
Go to solution
Solved by reniat,
posButtons[0] is [200,100]
posButtons[1] is [300,400]
posButtons[0][0] is 200
posButtons[0][1] is 100
posButtons[1][0] is 300
posButtons[1][1] is 400
when dealing with lists of lists, think about it from left to right: someList[top level list index][bottom level list index]
With a normal list of ints, [1,2,3], list[0] is going to be 1. So with a nested list: [[1,2,3], [4,5,6]], list[0] will still be the first element, which in this case is a list of [1,2,3], which we can then access like a normal list, hence the double bracket notation of [m][n].

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now