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 .
Output Format
First, print the inner product.
Second, print the outer product.

Hackerrank inner and outer problem solution in python

Problem solution in python 2 programming language.

import numpy

A = numpy.array(map(int, raw_input().split()))
B = numpy.array(map(int, raw_input().split()))

print numpy.inner(A, B)
print numpy.outer(A, B) 

Problem solution in python 3 programming language.

import numpy

A = numpy.array(map(int, input().split()))
B = numpy.array(map(int, input().split()))

print(numpy.inner(A, B))
print(numpy.outer(A, B))