mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-10 19:01:13 -04:00
fix(curriculum): less strict sudoku step 74 (#55088)
This commit is contained in:
@@ -14,7 +14,10 @@ Modify the `row_str` comprehension to give a string only when the item is not ze
|
||||
The list comprehension assigned to the `row_str` variable should call `str()` on each item `i` in `row` if `i` is truthy, and it should evaluate to `'*'` otherwise.
|
||||
|
||||
```js
|
||||
({ test: () => assert(runPython(`_Node(_code).find_class("Board").find_function("__str__").find_for_loops()[0].find_bodies()[0].find_variable("row_str").find_comp_expr().is_equivalent("str(i) if i else '*'")`)) })
|
||||
({ test: () => assert(runPython(`
|
||||
expressions = ["str(i) if i else '*'","'*' if i == 0 else str(i)","str(i) if i != 0 else '*'"]
|
||||
node =_Node(_code).find_class("Board").find_function("__str__").find_for_loops()[0].find_bodies()[0].find_variable("row_str").find_comp_expr()
|
||||
any(node.is_equivalent(expr) for expr in expressions)`)) })
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user