Skip to content

Commit b404784

Browse files
valentin-pBethanyG
authored andcommitted
fix pr feedbacks
1 parent f5c2665 commit b404784

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Python provides several useful methods that can be used to manipulate strings.
22
These methods can be used for cleaning, splitting, translating, or otherwise working with any object of type `str`.
33
Strings can be concatenated using the `+` operator or with `str.join()`.
4-
Strings also implement all of the common operations for a sequence and can be iterated using the syntax: `for item in <string>`.
4+
Strings also implement all common sequence operations and can be iterated through using the `for item in <string>` syntax.
55

66
Strings are immutable, meaning the value of a `str` object in memory cannot change.
7-
It means the standard library methods will return a new instance of `str` instead of modifying the existing `str`.
7+
That means any functions or methods that operate on a `str` object will return a _new instance_ or copy of that `str`, instead of modifying the original.

exercises/concept/little-sisters-essay/.docs/instructions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You have four tasks to clean up and modify strings.
44

55
## 1. Capitalize the title of the paper
66

7-
Any good paper needs a properly formatted title. Implement the function `capitalize_title()` which takes `title` as parameter and capitalizes the first letter of each word of the title. This function will return a `str`.
7+
Any good paper needs a properly formatted title. Implement the function `capitalize_title()` which takes `title` as a parameter, and capitalizes the first letter of each word of the title. This function will return a `str`.
88

99
```python
1010
>>> capitalize_title("my hobbies")
@@ -22,7 +22,8 @@ True
2222

2323
## 3. Clean up spacing
2424

25-
For the paper to look professional, you need to remove unnecessary spacing. Implement the function `remove_extra_spaces()` which takes `sentence` as a parameter and removes any extra whitespace at the beginning and the end of the sentence. This function should return a `str`.
25+
To make the paper _even better_, you can replace some of the adjectives with synonyms. Write the function `replace_word_choice()` that takes `sentence`, `old_word`, and `new_word` as parameters.
26+
This function should replace all instances of the `old_word` with the `new_word`, and return a new `str` with the updated sentence.
2627

2728
```python
2829
>>> remove_extra_spaces(" I like to go on hikes with my dog. ")
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Python provides several useful methods that can be used to manipulate strings.
2-
These methods can be used for cleaning, splitting, translating any variable of type `str`.
3-
Strings can be concatenated using the `+` operator or with `str.join()`.
4-
Strings also implement all of the common operations for a sequence and can be iterated using the syntax: `for item in <string>`.
2+
These methods can be used for cleaning, splitting, translating, or otherwise working with any object of type `str`.
3+
Strings can be concatenated using the `+` operator or with the `str.join()` method.
4+
Strings also implement all common sequence operations and can be iterated through using the `for item in <string>` syntax.
55

6-
`Strings` are immutable, meaning their value in memory cannot change.
7-
It means the standard library methods will return a new instance of `str` instead of modifying the existing `str`.
6+
Strings are immutable, meaning the value of a `str` object in memory cannot change.
7+
That means any functions or methods that operate on a `str` (like the ones we are learning about here) will return a _new instance_ of that `str` instead of modifying the original `str` object.

0 commit comments

Comments
 (0)