In Python, is it possible to write a function that returns the dimensions of a multidimensional array (given the assumption that the array\'s dimensions are not jagged)?
Assuming the input array is not jagged :
def arr_dimen(a): return [len(a)]+arr_dimen(a[0]) if(type(a) == list) else []