From 5782d0ebb0bbb36647dd66382979f15d1babaf28 Mon Sep 17 00:00:00 2001 From: Prabhakar Yadav <114614952+prabhakaryadav2003@users.noreply.github.com> Date: Thu, 9 Jan 2025 22:03:05 +0530 Subject: [PATCH] feat(curriculum): Added an additional test in the python challenge (#57854) Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com> Co-authored-by: Naomi --- .../66793c5b4bdacc17c40ff8e7.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/curriculum/challenges/english/07-scientific-computing-with-python/learn-interfaces-by-building-an-equation-solver/66793c5b4bdacc17c40ff8e7.md b/curriculum/challenges/english/07-scientific-computing-with-python/learn-interfaces-by-building-an-equation-solver/66793c5b4bdacc17c40ff8e7.md index f046fec8fb4..354ee604257 100644 --- a/curriculum/challenges/english/07-scientific-computing-with-python/learn-interfaces-by-building-an-equation-solver/66793c5b4bdacc17c40ff8e7.md +++ b/curriculum/challenges/english/07-scientific-computing-with-python/learn-interfaces-by-building-an-equation-solver/66793c5b4bdacc17c40ff8e7.md @@ -13,6 +13,16 @@ From now on, you'll keep building the output by concatenating strings to `output Create a string containing the string representation of your equation centered in a width of `24` characters. Make the string begin and end with two newline characters, and add your new string to the current value of `output_string`. +The output of the `solver` function should look like this: + +```md + +----Linear Equation----- + + 2x +3 = 0 + +``` + # --hints-- The `solver` function should return a different string. @@ -30,6 +40,15 @@ assert solver(eq) == expected `) }) ``` +You should use the conversion flag `!s` to convert `equation` into a string. + +```js +({ test: () => (runPython(` +function = str(_Node(_code).find_function("solver")) +assert "equation!s" in function +`)) }) +``` + # --seed-- ## --seed-contents--