if I have a nested list such as:
m=[[34,345,232],[23,343,342]]
if I write m.remove(345) it gives an error message saying the element is not in the list.
I want to know how to remove an element from the nested list, easily.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no shortcut for this. You have to remove the value from every nested list in the container list:
If you want similiar behavior like
list.remove, use something like the following: