You are viewing a single comment's thread. Return to all comments →
from itertools import product
A = set(input().split()) A = list(sorted((map(int,A)))) B = set(input().split()) B = list(sorted((map(int,B))))
def itertools_product(X,Y): for i in product(X,Y): print(i, end=' ')
result = itertools_product(A,B)
Seems like cookies are disabled on this browser, please enable them to open this website
itertools.product()
You are viewing a single comment's thread. Return to all comments →
from itertools import product
A = set(input().split()) A = list(sorted((map(int,A)))) B = set(input().split()) B = list(sorted((map(int,B))))
def itertools_product(X,Y): for i in product(X,Y): print(i, end=' ')
result = itertools_product(A,B)