---
id: 658244fdf4b0265334711664
title: Step 31
challengeType: 20
dashedName: step-31
---

# --description--

Finally, return the result of the `filter()` call.

# --hints--

You should return the result of the `filter()` call from your `filter_expenses_by_category` function.

```js
({ test: () => assert(runPython(`_Node(_code).find_function("filter_expenses_by_category").has_return("filter(lambda expense: expense['category'] == category, expenses)")`)) })
```

# --seed--

## --seed-contents--

```py
def add_expense(expenses, amount, category):
    expenses.append({'amount': amount, 'category': category})
    
def print_expenses(expenses):
    for expense in expenses:
        print(f'Amount: {expense["amount"]}, Category: {expense["category"]}')
    
def total_expenses(expenses):
    return sum(map(lambda expense: expense['amount'], expenses))
    
--fcc-editable-region--
def filter_expenses_by_category(expenses, category):
    filter(lambda expense: expense['category'] == category, expenses)
--fcc-editable-region--

expenses = []
```
