Inner and Outer

Sort by

recency

|

210 Discussions

|

  • + 0 comments

    import numpy arr_A = list(map(int, input().strip().split())) arr_B = list(map(int, input().strip().split())) print(numpy.inner(arr_A, arr_B)) print(numpy.outer(arr_A, arr_B))

  • + 0 comments

    import numpy as np

    a = list(map(int, input().split())) b = list(map(int, input().split()))

    print(np.inner(a,b))

    print(np.outer(a,b))

  • + 0 comments

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

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