hacker rank python(itertools.product())

ITERTOOLS.PRODUCT()


# Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import product

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

print(*product(a, b))

Compiler Message
Success
Input (stdin)Download
1 2
3 4
Expected OutputDownload
(1, 3) (1, 4) (2, 3) (2, 4)

Comments

Anonymous said…
A = raw_input().split()
A = list(map(int, A))
B = raw_input().split()
B = list(map(int, B))

for i in product(A, B):
print i,

Popular posts from this blog

Amazon Web Services

Google Code-In mentorship experience :)

Hacker Rank all java and python problem solutions