Zeros and Ones

Sort by

recency

|

303 Discussions

|

  • + 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_))

  • + 0 comments

    import numpy as np

    size = tuple(map(int, input().strip().split())) print(np.zeros(size, dtype=np.int16)) print(np.ones(size, dtype=np.int16))

  • + 0 comments
    import numpy
    l = list(map(int,input().split()))
    a = numpy.zeros(l,dtype=int)
    b = numpy.ones(l,dtype=int)
    print(a)
    print(b)
    
  • + 0 comments

    ar = list(map(int,input().split()))

    ex = (np.zeros(ar, dtype = int))

    ey = (np.ones(ar, dtype = int))

    print(ex)

    print(ey)