. Advertisement .
..3..
. Advertisement .
..4..
I am new to python. I need some suggestions on subtract a list from another list python. Will you help me? Thank you!
Here is a suggestion for youc = [x for x in a if x not in b]
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.
The truth is out there!
To subtract, you need two lists of the same length. Each list includes elements that have the same type. Then, you can find the difference of these two lists at each index position.