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
- Itertools
- itertools.product()
- Discussions
itertools.product()
itertools.product()
Sort by
recency
|
824 Discussions
|
Please Login in order to post a comment
Try Using *args
A = list(map(int,input().split())) B = list(map(int,input().split())) c=[] for i in A: for j in B: c.append((i,j))
for i in c: print(i,end=" ")
import itertools
Taking input for list A
A = list(map(int, input().split()))
Taking input for list B
B = list(map(int, input().split()))
cartesian_product = list(itertools.product(A, B))
for pair in cartesian_product: print(pair, end=" ")
Enter your code here. Read input from STDIN. Print output to STDOUT
import itertools
Taking input for list A
A = list(map(int, input().split()))
Taking input for list B
B = list(map(int, input().split()))
cartesian_product = list(itertools.product(A, B))
for pair in cartesian_product: print(pair, end=" ")