Skip to content

Files

Latest commit

a17ad43 · Aug 23, 2018

History

History

itertools.product()

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 23, 2018
Aug 23, 2018

itertools.product()

You are given a two lists A and B. Your task is to compute their cartesian product A X B.

Input Format
The first line contains the space separated elements of list A.
The second line contains the space separated elements of list B.

Both lists have no duplicate integer elements.

Output Format
Output the space separated tuples of the cartesian product.

Constraints
0 < A < 30
0 < B < 30

Sample Input
1 2
3 4

Sample Output
(1, 3) (1, 4) (2, 3) (2, 4)