Python: Remove the specific item from a given list of lists
Remove Item from List of Lists
Write a Python program to remove a specific item from a given list of lists.
Sample Solution:
Python Code:
Sample Output:
Original list of lists: [['Red', 'Maroon', 'Yellow', 'Olive'], ['#FF0000', '#800000', '#FFFF00', '#808000'], ['rgb(255,0,0)', 'rgb(128,0,0)', 'rgb(255,255,0)', 'rgb(128,128,0)']] Remove 1st item from the said list of lists: [['Maroon', 'Yellow', 'Olive'], ['#800000', '#FFFF00', '#808000'], ['rgb(128,0,0)', 'rgb(255,255,0)', 'rgb(128,128,0)']] Remove 2nd item from the said list of lists: [['Red', 'Yellow', 'Olive'], ['#FF0000', '#FFFF00', '#808000'], ['rgb(255,0,0)', 'rgb(255,255,0)', 'rgb(128,128,0)']] Remove 4th item from the said list of lists: [['Red', 'Maroon', 'Yellow'], ['#FF0000', '#800000', '#FFFF00'], ['rgb(255,0,0)', 'rgb(128,0,0)', 'rgb(255,255,0)']]
Flowchart:

For more Practice: Solve these Related Problems:
- Write a Python program to remove an item from each sublist in a given list of lists.
- Write a Python program to remove a specific element from all sublists while keeping the list structure intact.
- Write a Python program to remove all occurrences of a specific value from a list of lists.
- Write a Python program to remove duplicate elements from each sublist in a list of lists.
Go to:
Previous: Write a Python program to sort a given list of strings(numbers) numerically.
Next: Write a Python program to remove empty lists from a given list of lists.
Python Code Editor:
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.