# initialize lists listA = [1, 4, 6, 7] listB = [1, 3] # Construct Cartesian Product Tuple list # using list comprehension res = [(a, b) for a in listA for b in listB] # printing result print("The Cartesian Product is : " + str(res))