Input Format
A single line containing the space-separated integers.
Constraints
Output Format
First, print the array using the numpy.zeros tool and then print the array with the numpy.ones tool.

hackerrank zeros and ones problem solution in python programming

Problem solution in Python 3 programming language.

import numpy
N = tuple(map(int, input().split()))             
print(numpy.zeros(N, dtype = numpy.int))
print(numpy.ones(N, dtype = numpy.int))

Second solution

import numpy
nums = tuple(map(intinput().split()))
print (numpy.zeros(nums, dtype = numpy.int))
print (numpy.ones(nums, dtype = numpy.int))

Problem solution in Python 2 programming language.

import numpy
N = tuple(map(int, raw_input().split()))    
print numpy.zeros(N, dtype = numpy.int) 
print numpy.ones(N, dtype = numpy.int)