如何找到二维数组中有多少行和列?
例如,
Input = ([[1, 2], [3, 4], [5, 6]])`
应该显示为 3 行 2 列。
最佳答案
像这样:
numrows = len(input) # 3 rows in your example
numcols = len(input[0]) # 2 columns in your example
假设所有子列表的长度相同(即不是交错数组)。
关于python - 查找二维数组Python的长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10713004/