mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
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 <accounts+github@nhcarrigan.com>
This commit is contained in:
co-authored by
Dario-DC
Naomi
parent
90d53216b5
commit
5782d0ebb0
+19
@@ -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--
|
||||
|
||||
Reference in New Issue
Block a user