如何在Python中获取列表列表的长度?

您可以使用嵌套循环来计算列表的每个子列表中的元素数

>>> a=[[1, 2, 3], [4, 5, 6]]
>>> c=0
>>> for x in a:
      for y in x:
      c=c+1


>>> c
6