Filtering out specific terms
问题 I have written a function that uses derivative product rule to find derivative of a term: def find_term_derivative(term): x , y = term new_term = (y*x, y-1) return new_term def find_derivative(function_terms): new_function = [] for term in function_terms: new_term = find_term_derivative(term) new_function.append(new_term) filtered_terms = filter(zero_filter, new_term) find_derivative[(4, 3), (-3, 1)] Ouputs [(12, 2), (-3, 0)] However I want to use the filter function to remove any terms which