fix(curriculum): restore commented function call in step 51, python cipher project (#54874)

This commit is contained in:
Dario-DC
2024-05-20 08:06:46 -07:00
committed by GitHub
parent 5c19e29d39
commit d7ae42e2ab
3 changed files with 5 additions and 13 deletions
@@ -18,18 +18,10 @@ Parameters are variables that you can use inside your function. A function can b
Modify your function declaration so that it takes two parameters called `message` and `offset`.
After that, you'll see an error appear in the terminal. As a temporary fix, comment out the `caesar()` call.
After that, you'll see an error appear in the terminal. You'll see how to solve it in the next steps.
# --hints--
You should comment out the `caesar()` function call.
```js
({test: () => assert(runPython(
`not _Node(_code).find_calls('caesar')`
))})
```
Your `caesar` function should take `message` and `offset` as the parameters. Remember to separate the parameters with a comma.
```js
@@ -45,6 +37,7 @@ text = 'Hello Zaira'
shift = 3
--fcc-editable-region--
def caesar():
--fcc-editable-region--
alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''
@@ -59,5 +52,4 @@ def caesar():
print('encrypted text:', encrypted_text)
caesar()
--fcc-editable-region--
```
@@ -46,6 +46,6 @@ def caesar(message, offset):
print('plain text:', text)
print('encrypted text:', encrypted_text)
#caesar()
caesar()
--fcc-editable-region--
```
@@ -7,7 +7,7 @@ dashedName: step-53
# --description--
Now, uncomment your `caesar()` call. You'll see that your code raises a `TypeError`, because the `caesar` function is defined with two parameters (`message` and `offset`), therefore it expects to be called with two *arguments*.
Currently, your code raises a `TypeError`, because the `caesar` function is defined with two parameters (`message` and `offset`), therefore it expects to be called with two *arguments*.
Calling `caesar()` without the required arguments stops the execution of the code.
@@ -47,6 +47,6 @@ def caesar(message, offset):
print('plain text:', message)
print('encrypted text:', encrypted_text)
--fcc-editable-region--
# caesar()
caesar()
--fcc-editable-region--
```