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')


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube