mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-13 00:03:05 +08:00
fix(curriculum): add reminder to include final colon for if and else statements (#54463)
Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ const {block_body} = __helpers.python.getBlock(commentless_code, /for\s+char\s+i
|
||||
assert.notMatch(block_body, /print\s*\(\s*char\s*==\s*("|')\s\1\s*\)/);
|
||||
```
|
||||
|
||||
You should replace `print(char == ' ')` with an `if` statement that triggers when `char == ' '`. Do not use parentheses to enclose the `if` condition.
|
||||
You should replace `print(char == ' ')` with an `if` statement that triggers when `char == ' '`. Do not use parentheses to enclose the `if` condition and remember to include the final colon.
|
||||
|
||||
```js
|
||||
const commentless_code = __helpers.python.removeComments(code);
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ To fix it, add an `else` clause after `encrypted_text += char` and indent all th
|
||||
|
||||
# --hints--
|
||||
|
||||
You should create an `else` clause.
|
||||
You should create an `else` clause. Remember to include the final colon.
|
||||
|
||||
```js
|
||||
const commentless_code = __helpers.python.removeComments(code);
|
||||
|
||||
Reference in New Issue
Block a user