fix(curriculum): use output test for bill splitter step 4 print hint (#67444)

This commit is contained in:
majestic-owl448
2026-05-18 10:09:37 +02:00
committed by GitHub
parent ff00be8d62
commit 21b8619aa2
@@ -43,9 +43,16 @@ You should print the string `Total bill so far:` followed by a space and the val
```js
({
test: () => runPython(`
sol1 = "print('Total bill so far:', running_total)"
sol2 = "print(f'Total bill so far: {running_total}')"
assert _Node(_code).has_call(sol1) or _Node(_code).has_call(sol2)`)
import io, contextlib
_expected = f"Total bill so far: {37.89 + 57.34 + 39.39 + 64.21}"
buffer = io.StringIO()
with contextlib.redirect_stdout(buffer):
exec(_code)
assert _expected in buffer.getvalue()
`)
})
```