HackerRank- Python Zeros and Ones



Given the shape of the array in the form of space-separated integers, each integer representing the size of different dimensions, your task is to print an array of the given shape and integer type using the tools numpy.zeros and numpy.ones



  1. import numpy as np
  2. shape= tuple(map(int,input().split()))
  3. print(np.zeros(shape,int), np.ones(shape,int), sep='\n')

download android app