fix(curriculum): less strict sudoku step 74 (#55088)

This commit is contained in:
Anna
2024-06-05 08:51:58 -04:00
committed by GitHub
parent 71a811a5ba
commit c5fa9c7f00

View File

@@ -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--