In this Python list program, we will take two lists as input and iterate over lists to create a list of sublists with the help of the below-given steps.
Create a list of sublists:
Steps to solve the program
- Take two lists as inputs.
- Create an empty list to store a list of sublists.
- Use for loop and zip function to combine the input lists and add them to the empty list.
- Print the list to see the output.
Output :
Related Articles
Python program to move all positive numbers on the left side and negative numbers on the right side.
Python program to move all zero digits to the end of a given list of numbers.
Python program to find the list in a list of lists whose sum of elements is the highest.
Python program to find the items that start with a specific character from a given list.
Python program to count empty dictionaries from the given list.
Python program to remove consecutive duplicates of given lists.