91. Problem to convert tuples in list into a sublist.

In this Python list program, we will take a list of tuples as input and convert tuples in list into a sublist with the help of the below-given steps.

Convert tuples in list to sublist:

Steps to solve the program
  1. Take a list containing tuples as input.
  2. Using for loop convert tuples in list to sublist.
  3. If the iterated element has type tuple then use nested for lopp to iterate over elements in the tuple.
  4. Add the elements to the empty list using the append() function
  5. And add those lists as sublists to another list.
  6. Print the list to see the result.

Output :

Related Articles

Flatten given nested list structure

Create a dictionary from a sublist in given list

Leave a Comment