fix(curriculum): replace misleading return in Expense Tracker project, step 21 (#55396)

This commit is contained in:
Dario-DC
2024-07-02 22:18:19 +02:00
committed by GitHub
parent b6128dac79
commit 1824f14146
@@ -7,11 +7,11 @@ dashedName: step-21
# --description--
Within the `filter_expenses_by_category` function, replace `pass` with a `lambda` function. Use `expense` as the parameter and return the comparison between the value of the `'category'` key of the `expense` dictionary and `category` using the equality operator.
Within the `filter_expenses_by_category` function, replace `pass` with a `lambda` function. Use `expense` as the parameter and evaluate the comparison between the value of the `'category'` key of the `expense` dictionary and `category` using the equality operator.
# --hints--
You should create a `lambda` function that uses a parameter named `expense` and returns the expression `expense['category'] == category` inside the `filter_expenses_by_category` function.
You should create a `lambda` function that uses a parameter named `expense` and evaluates the expression `expense['category'] == category` inside the `filter_expenses_by_category` function.
```js
({ test: () => assert(runPython(`_Node(_code).find_function("filter_expenses_by_category").has_stmt("lambda expense: expense['category'] == category")`)) })