In this Python list program, we will take two lists of lists as input and zip two lists of lists into a list with the help of the below-given steps.
Zip two lists:
Steps to solve the program
- Take two lists of lists as input.
- Combine / zip two lists inside a new list using the zip() function.
- Print the list to see the output.
#Input list
list1 = [[1, 3], [5, 7], [9, 11]]
list2 = [[2, 4], [6, 8], [10, 12, 14]]
#Creating new list
list3 = list(zip(list1,list2))
#Printing output
print(list3)
Output :
[([1, 3], [2, 4]), ([5, 7], [6, 8]), ([9, 11], [10, 12, 14])]
Related Articles
Python program to convert the first and last letter of each item from Upper case and lowercase.
Python to find maximum and minimum values in the given heterogeneous list.
Python program to sort a given list in ascending order according to the sum of its sublist.
Python program to extract the specified sizes of strings from a given list of string values.
Python program to find the difference between consecutive numbers in a given list.
Python program to calculate the average of the given list.