60. Problem to zip two lists of lists into a list.

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
  1. Take two lists of lists as input.
  2. Combine / zip two lists inside a new list using the zip() function.
  3. 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

Create a 3*3 grid with numbers

Character to Uppercase and lowercase

Leave a Comment