How to Find the Shape of a Nested List or Tuple in Python
Finding the shape of a nested list or tuple is much more complicated than finding the shape of a single element because each element in a list of lists or tuple of tuples can have a different dimension. Unlike NumPy arrays, lists and tuples aren’t required to have a set number of rows or columns….