I am trying to find a way to check a list which contains several other lists for a specific element and delete it.
So basically I have 2 lists (a and b) which are combined in another list (c)
a= ["aa","bb"]
b= ["aa","dd"]
c=[a,b]
Now I am trying to delete all elements named "aa"
c.remove("aa")
Sadly this doesn't work and I get the error "ValueError: list.remove(x): x not in list" because "aa" is not literally mentioned in c.
In the end I also want to print out all the lists in c and what they contain. Something like that:
c= a: bb, b: dd
Is there a way to delete elements in several lists with a single command like I tried with combining them in another list c?
And how can I print out the list c in the end similar to how I described it above?