array of array python code example
Example 1: python arrays
array = [1,2,3,4,5]
print(array,array[0],array[1],array[2],array[3],array[4]
Example 2: array in array python
tests = [[1,2,3],["r",22,33]]
Example 3: how to make an array in python
import numpy
array = numpy.array(["Ford", "Volvo", "BMW"] )
Example 4: create a 2d array in python
def build_matrix(rows, cols):
matrix = []
for r in range(0, rows):
matrix.append([0 for c in range(0, cols)])
return matrix
if __name__ == '__main__':
build_matrix(6, 10)