Get List Shape in Python | Delft Stack
www.delftstack.com › howto › pythonThe following code example shows how we can get the shape of a list using the numpy.shape () method. Python. python Copy. import numpy as np lista = [1,2,3,4,5] listb = [[1,2,3],[4,5,6]] print("Shape of lista is : "+str(np.shape(lista))) print("Shape of listb is : "+str(np.shape(listb))) Output: text Copy.