itertools.product()

  • + 0 comments

    A Clear & Understandable Snippet

    from itertools import product

    a=input().split() b=input().split() lst=[] for i in a: if i.isdigit: lst.append(int(i))

    lst2=[] for j in b: if j.isdigit: lst2.append(int(j))

    a=list(product(lst,lst2))

    for x in a: print(x,end=' ')