48. Problem to create a list of sublists.

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
  1. Take two lists as inputs.
  2. Create an empty list to store a list of sublists.
  3. Use for loop and zip function to combine the input lists and add them to the empty list.
  4. Print the list to see the output.

Output :

Related Articles

Insert a given string at the beginning

Move all positive numbers on the left

Leave a Comment