You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this exercise you are helping your younger sister edit her paper for school. The teacher is looking for correct punctuation, grammar, and excellent word choice.
1
+
In this exercise, you are helping your younger sister edit her paper for school. The teacher is looking for correct punctuation, grammar, and excellent choice of words.
2
2
3
3
You have four tasks to clean up and modify strings.
4
4
5
5
## 1. Capitalize the title of the paper
6
6
7
-
Any good paper needs a properly formatted title. Implement the function `capitalize_title()` which takes in the parameter `title` 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 parameter and capitalizes the first letter of each word of the title. This function will return a `str`.
8
8
9
9
```python
10
10
>>> capitalize_title("my hobbies")
@@ -13,7 +13,7 @@ Any good paper needs a properly formatted title. Implement the function `capital
13
13
14
14
## 2. Check if each sentence ends with a period
15
15
16
-
You want to make sure that the punctuation in the paper is perfect. Implement the function `check_sentence_ending()` that takes in the parameter `sentence`. This function should return a `bool`.
16
+
You want to make sure that the punctuation in the paper is perfect. Implement the function `check_sentence_ending()` that takes `sentence` as a parameter. This function should return a `bool`.
17
17
18
18
```python
19
19
>>> check_sentence_ending("I like to hike, bake, and read.")
@@ -22,7 +22,7 @@ True
22
22
23
23
## 3. Clean up spacing
24
24
25
-
To make the paper look professional, unnecessary spacing needs to be removed. Implement the function `remove_extra_spaces()` which takes in the parameter `sentence` and removes extra whitespace at the beginning and at the end of the sentence. This function should return a `str`.
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`.
26
26
27
27
```python
28
28
>>> remove_extra_spaces(" I like to go on hikes with my dog. ")
@@ -31,9 +31,9 @@ To make the paper look professional, unnecessary spacing needs to be removed. Im
31
31
32
32
## 4. Replace words with a synonym
33
33
34
-
To make the paper even better, you can replace some of the adjectives with synonyms. Write a function `replace_word_choice()` that takes in the parameters `sentence`, `old_word`, and `new_word`. This function should replace all instances of the `old_word` with the `new_word` and return the updated sentence. The function should return a `str`.
34
+
To make the paper even better, you can replace some of the adjectives with synonyms. Write a function `replace_word_choice()` that takes `sentence`, `old_word`, and `new_word` as parameters. This function should replace all instances of the `old_word` with the `new_word` and return the updated sentence. The function should return a `str`.
35
35
36
36
```python
37
-
>>> replace_word_choice("I bake good cakes", "good", "amazing")
38
-
"I bake amazing cakes"
37
+
>>> replace_word_choice("I bake good cakes.", "good", "amazing")
0 commit comments