mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(curriculum): restore commented function call in step 51, python cipher project (#54874)
This commit is contained in:
+2
-10
@@ -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--
|
||||
```
|
||||
|
||||
+1
-1
@@ -46,6 +46,6 @@ def caesar(message, offset):
|
||||
print('plain text:', text)
|
||||
print('encrypted text:', encrypted_text)
|
||||
|
||||
#caesar()
|
||||
caesar()
|
||||
--fcc-editable-region--
|
||||
```
|
||||
|
||||
+2
-2
@@ -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--
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user