Avatar ·

Creation of a N-dimensional array of length n

📁 List, Advanced Python Topics, question, example

Can I create N -dimensional array? If so, how to realize it? If the matrix is a "list of lists", then it will look something like this:

  [[...]], [[...] ...]]  

, or to make it more clear, like n nested segments, the picture below,

  (A1 [...] ...] B1, a2_m [...] ...] b2_m, ...)  

and how to realize it in the code? If, say, I need to input n from the keyboard. Thank you very much!