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.
- Prepare
- Python
- Numpy
- Zeros and Ones
- Discussions
Zeros and Ones
Zeros and Ones
Sort by
recency
|
310 Discussions
|
Please Login in order to post a comment
import numpy user_input = input().split() d =tuple(map(int,user_input)) print(numpy.zeros((d),dtype = 'int')) print(numpy.ones((d),dtype = 'int'))
Here is the solution :)
import numpy as np
n = input()
l1 = list(map(int,n.split(' ')))
arr = np.zeros((l1),dtype=int) print(arr) arr = np.ones((l1),dtype=int) print(arr)
For Python3 Platform