mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): replace misleading return in Expense Tracker project, step 21 (#55396)
This commit is contained in:
+2
-2
@@ -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")`)) })
|
||||
|
||||
Reference in New Issue
Block a user