Inner and Outer

Sort by

recency

|

207 Discussions

|

  • + 0 comments

    Well Solution

    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 as np
    a, b = [np.array(list(map(int,input().split()))) for _ in range(2)]
    print(np.inner(a,b),np.outer(a,b),sep ='\n')
    
  • + 0 comments

    import numpy a=list(map(int,input().split())) b=list(map(int,input().split())) arr1=numpy.array(a) arr2=numpy.array(b) print(numpy.inner(a,b)) print(numpy.outer(a,b))

  • + 0 comments

    Task

    You are given two arrays: and . Your task is to compute their inner and outer product.

    Input Format

    The first line contains the space separated elements of array . The second line contains the space separated elements of array .

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