Two dimensional array in python

You do not “declare” arrays or anything else in python. You simply assign to a (new) variable. If you want a multidimensional array, simply add a new array as an array element. arr = [] arr.append([]) arr[0].append(‘aa1’) arr[0].append(‘aa2’) or arr = [] arr.append([‘aa1’, ‘aa2’])

Ruby multidimensional array

Strictly speaking it is not possible to create multi dimensional arrays in Ruby. But it is possible to put an array in another array, which is almost the same as a multi dimensional array. This is how you could create a 2D array in Ruby: a = [[1,2,3], [4,5,6], [7,8,9]] As stated in the comments, … Read more