Inner and Outer

Sort by

recency

|

212 Discussions

|

  • + 0 comments
    import numpy as np 
    
    input_array_A = np.array(list(map(int, input().split())))
    input_array_B = np.array(list(map(int, input().split())))
    
    print(np.inner(input_array_A,input_array_B))
    print(np.outer(input_array_A,input_array_B))
    
  • [deleted]Challenge Author
    + 0 comments

    For Python3

    from numpy import array, inner, outer
    
    A = array([*map(int, input().split())])
    B = array([*map(int, input().split())])
    
    print(inner(A, B))
    print(outer(A, B))
    
  • + 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))