Inner and Outer

Sort by

recency

|

223 Discussions

|

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

  • + 1 comment

    Compact code with a hidden message.

    import numpy as np
    a, b = [np.array(list(map(int, input().split()))) for _ in [86, 47]]
    print(np.inner(a, b), np.outer(a, b), sep='\n')
    
  • + 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), np.outer(A, B), sep='\n')