itertools.product()

  • + 0 comments

    Try Using *args

    from itertools import product
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    
    print ( * list(product(a,b)) )