We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Inner and Outer
- Discussions
Inner and Outer
Inner and Outer
Sort by
recency
|
220 Discussions
|
Please Login in order to post a comment
Compact code with a hidden message.
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')
Here is HackerRank Inner and Outer in Python solution - https://programmingoneonone.com/hackerrank-inner-and-outer-problem-solution-in-python.html
import numpy as np
A = np.array(list(map(int, input().split()))) b = np.array(list(map(int, input().split())))
inner_product = np.inner(A,B) outer_product = np.outer(A,B) print(inner_product) print(outer_product)