python foreach 2d array