From 21b8619aa2ae2b30d1e52906d2c6707ef7be3fa0 Mon Sep 17 00:00:00 2001 From: majestic-owl448 <26656284+majestic-owl448@users.noreply.github.com> Date: Mon, 18 May 2026 10:09:37 +0200 Subject: [PATCH] fix(curriculum): use output test for bill splitter step 4 print hint (#67444) --- .../6982684f3a25f379e195a5fc.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/blocks/workshop-bill-splitter/6982684f3a25f379e195a5fc.md b/curriculum/challenges/english/blocks/workshop-bill-splitter/6982684f3a25f379e195a5fc.md index bffcac50bc0..61292c48d32 100644 --- a/curriculum/challenges/english/blocks/workshop-bill-splitter/6982684f3a25f379e195a5fc.md +++ b/curriculum/challenges/english/blocks/workshop-bill-splitter/6982684f3a25f379e195a5fc.md @@ -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() +`) }) ```