mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-31 18:01:36 -04:00
fix(curriculum): correct Challenge 229 truncate text instructions and Python hint (#66673)
This commit is contained in:
committed by
GitHub
parent
a25d278b37
commit
522bd8650b
@@ -24,7 +24,7 @@ The table above includes all upper and lower case letters. Additionally:
|
||||
- Periods (`"."`) have a width of 1
|
||||
|
||||
- If the given string is 50 units or less, return the string as-is, otherwise
|
||||
- Truncate the string and add three periods at the end (`"..."`) so it's total width, including the three periods, is as close as possible to 60 units without going over.
|
||||
- Truncate the string and add three periods at the end (`"..."`) so its total width, including the three periods, is as close as possible to 50 units without going over.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ The table above includes all upper and lower case letters. Additionally:
|
||||
- Periods (`"."`) have a width of 1
|
||||
|
||||
- If the given string is 50 units or less, return the string as-is, otherwise
|
||||
- Truncate the string and add three periods at the end (`"..."`) so it's total width, including the three periods, is as close as possible to 60 units without going over.
|
||||
- Truncate the string and add three periods at the end (`"..."`) so its total width, including the three periods, is as close as possible to 50 units without going over.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -37,12 +37,12 @@ TestCase().assertEqual(truncate_text("The quick brown fox"), "The quick brown f.
|
||||
}})
|
||||
```
|
||||
|
||||
`truncate_text("The silky smooth sloth")` should return `truncate_text("The silky smooth sloth")`.
|
||||
`truncate_text("The silky smooth sloth")` should return `"The silky smooth s..."`.
|
||||
|
||||
```js
|
||||
({test: () => { runPython(`
|
||||
from unittest import TestCase
|
||||
TestCase().assertEqual(truncate_text("The silky smooth sloth"), truncate_text("The silky smooth sloth"))`)
|
||||
TestCase().assertEqual(truncate_text("The silky smooth sloth"), "The silky smooth s...")`)
|
||||
}})
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user