34. Problem to combine two list elements as a sublist.

We will take two lists as input & iterate all the elements one by one with the Python loop. Combine two list elements from both lists as a sublist with the help of the below-given steps.

Combine two list elements:

  1. Take two lists as input.
  2. combine both lists using zip().
  3. Add the combined elements to an empty list.
  4. Use for loop for this purpose.
  5. Print the list to see the output.

Output :

Related Articles

Reverse each element of the list

Get keys and values from the list of dictionaries

Leave a Comment