Inner and Outer

Sort by

recency

|

225 Discussions

|

  • + 0 comments
    import numpy
    
    A = numpy.array(list(map(int, input().split())))
    B = numpy.array(list(map(int, input().split())))
    print(numpy.inner(A,B))
    print(numpy.outer(A,B))
    
  • + 0 comments
    import numpy
    a=numpy.array(input().split(),int)
    b=numpy.array([input().split()],int)
    print(*numpy.inner(a,b))
    print(numpy.outer(a,b))
    
  • + 0 comments
    import numpy 
    a = numpy.array(input().split(), int)
    b = numpy.array(input().split(), int)
    print(numpy.inner(a,b),
            numpy.outer(a,b),
            sep = "\n")
    
  • + 0 comments

    For Python3 Platform

    import numpy
    
    A = numpy.array(input().split(), int)
    B = numpy.array(input().split(), int)
    
    print(numpy.inner(A, B))
    print(numpy.outer(A, B))
    
  • + 0 comments

    import numpy A = list(map(int,input().split())) B = list(map(int,input().split())) A1 = numpy.array(A) A2 = numpy.array(B) print(numpy.inner(A1,A2)) print(numpy.outer(A1,A2))