itertools.product()

  • + 0 comments

    from itertools import product

    space_separted_element_a = list(map(int,input().split())) space_separted_element_b = list(map(int,input().split()))

    print(*product(space_separted_element_a,space_separted_element_b))

    Product is like a For loop

    Pairs = []

    for x in [1,2]:

    for y in [3,4]:

    pairs.append((x,y))

    print(Pairs)