Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python number of elements in multidimensional array

#Example for a 2D list
an_array = [[1, 2], [3, 4, 5]]
total_length = sum(len(row) for row in an_array)
print(total_length)
#OUTPUT: 5
 
PREVIOUS NEXT
Tagged: #python #number #elements #multidimensional #array
ADD COMMENT
Topic
Name
1+9 =