We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
We are taking input as a single line and splitting it to a list of strings. Using map we are mapping each string to list of ints.
We are passing lists into a tuple.
As per numpy docs. We need to pass a tuple to numpy.zeros or numpy.ones array.
In above code he is passing tuple directly to function.
Cookie support is required to access HackerRank
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 →
Hi Dinesh,
nums = tuple(map(int, input().split()))
We are taking input as a single line and splitting it to a list of strings. Using map we are mapping each string to list of ints. We are passing lists into a tuple.
As per numpy docs. We need to pass a tuple to numpy.zeros or numpy.ones array. In above code he is passing tuple directly to function.