It’s hard for me to figure out how to remove something from a nested list.
For example, how to remove the "x" from the list below?
lst = [['x',6,5,4],[4,5,6]]
I tried del lst[0][0] but got the following result:
TypeError: object 'str' does not support deleting an element.
I also tried the for loop, but got the same error:
for char in lst: del char[0]
Emily source share