Zeros and Ones

Sort by

recency

|

306 Discussions

|

  • + 0 comments
    import sys, numpy
    
    size = ([int(digit) for digit in sys.stdin.read().replace(' ', '')])
    
    print(numpy.zeros(size, int), numpy.ones(size, int), sep='\n')
    
  • [deleted]Challenge Author
    + 0 comments

    For Python3

    import numpy as np
    
    size = tuple(map(int, input().split()))
    
    print(np.zeros(size, dtype = int))
    print(np.ones(size, dtype = int))
    
  • + 0 comments

    I Code this but it dosen't approved my solve why? y = np.zeros(([3,3,3]),dtype=np.int32) print(y) x = np.ones(([3,3,3]),dtype=np.int32) print(x)

  • + 0 comments
    t = tuple( map(int, (input().split(" "))))
    print(numpy.zeros((t), dtype = int))
    print(numpy.ones((t), dtype = int))
    

    dtype = depending on the version used

  • + 0 comments

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