You are viewing a single comment's thread. Return to all comments →
My solution:
import numpy N = tuple(map(int,input().strip().split())) z = numpy.zeros(N, dtype=numpy.int) o = numpy.ones(N, dtype=numpy.int) print (z) print (o)
The number of inputs indicates the size of Matrix's dimension.
Such as, input three numbers:
3 3 3
it means the Matrix is 3x3x3, so call numpy.zeros((3,3,3),dtype=numpy.int) to generate the Matrix.
numpy.zeros((3,3,3),dtype=numpy.int)
Seems like cookies are disabled on this browser, please enable them to open this website
Zeros and Ones
You are viewing a single comment's thread. Return to all comments →
My solution:
The number of inputs indicates the size of Matrix's dimension.
Such as, input three numbers:
it means the Matrix is 3x3x3, so call
numpy.zeros((3,3,3),dtype=numpy.int)
to generate the Matrix.