You can download this code by clicking the button below.
This code is now available for download.
The function takes an arbitrary number of arguments, each of which is a list, and returns a list containing the Cartesian product of all argument lists.
Technology Stack : List comprehension
Code Type : Generate the Cartesian product of the list
Code Difficulty : Intermediate
def zip(*args):
ziped_list = []
for i in range(len(args[0])):
ziped_list.append([args[j][i] for j in range(len(args))])
return ziped_list