fix(curriculum): correct Challenge 229 truncate text instructions and Python hint (#66673)

This commit is contained in:
Keerti Krishna Sreenivas S
2026-03-31 13:12:11 +05:30
committed by GitHub
parent a25d278b37
commit 522bd8650b
2 changed files with 4 additions and 4 deletions

View File

@@ -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--

View File

@@ -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...")`)
}})
```