Skip to content

Commit 1f25cf1

Browse files
committed
added some text edits and rewording in re issues #5#1
1 parent e8c4677 commit 1f25cf1

File tree

2 files changed

+36
-93
lines changed

2 files changed

+36
-93
lines changed

README.md

Lines changed: 19 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,54 @@
55

66
In the past few lessons, we have learned about working with different types of data in Python: strings, numbers (ints and floats), and booleans. Now let's put that knowledge into action.
77

8-
In this lesson we'll imagine that you just stopped by an Python programming conference and met a few people there. You exchanged some information with a very industrious person who you met, and want to use your programming skills to format this information correctly.
8+
In this lesson we'll imagine that we were at a nice social gathering and exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. We want to use our programming skills to format this information correctly.
99

1010
### Learning Objectives
1111
* Manipulate strings with built-in methods
1212
* Practice coercing data types and changing numbers
1313

1414
### Here to mingle
1515

16-
The next morning you take out the business card, ready to format it using your programming skills, and here is what you find.
16+
The next morning we take out the business card, ready to format it using our programming skills, and here is what we find.
1717

18-
![](./biz-card-mistakes.jpg)
18+
![](https://learn-verified.s3.amazonaws.com/data-science-assets/biz-card-mistakes.jpg)
1919

20-
Yea, he may not be the best person to get to know. But we know that when people fill out forms, they misenter information all of the time. As a celebrity once said, "I'm really getting into the Internet lately, I just wish it were more organized."
20+
Yea, Mr. Vandelay may not be the best person to get to know or the best at designing business cards, but like Mr. Vandelay, we know that people misenter information on forms all the time.
2121

22-
And as data scientists, we also see the need of organizing and cleaning data to then make sense of it. So let's get to work.
22+
So as data scientists, we often need to clean and organize data before we can make sense of it. Let's get to work.
2323

24-
### Solving your first lab
24+
### Solving our first lab
2525

26-
This is your first lab, and here you'll see that we have provided some data for you. Next to the data, you will see a comment indicating what the data should look after you change it. Let's do the first one together. For example, let's say we want to capitalize all of the letters of "art vandlay" (to remind ourselves of how he made his introduction). You'll see the following:
26+
This is our first lab, and here we'll see that there is some data already provided for us. Next to the data, we will see a comment indicating what the data should look like after we change it. Let's do the first one together.
27+
28+
For example, let's say we want to capitalize all of the letters of "art vandlay". We'll see the following:
2729

2830

2931
```python
3032
"art vandelay" # 'ART VANDELAY'
3133
```
3234

35+
Notice that there is no output below the gray code above. This is because Jupyter notebooks do not automatically run our code - so they do not automatically know the output. To display the output, we must **run** the code by clicking on the gray cell and then pressing shift + enter. Let's try it in the cell above and see our output appear below.
3336

34-
35-
36-
'art vandelay'
37-
38-
39-
40-
That hash tag to the right is a comment. Comments are used for programmers to annotate their code. But a comment has no impact on the code.
37+
Ok, once we see the output take a look at the hash tag to the right of the string. The hash tag to the right is a comment. Comments are used for programmers to annotate their code, but a comment has no impact on the code. See this by running the next cell below (again, press shift + enter).
4138

4239

4340
```python
4441
'hello'
4542
### whattttt
4643
```
4744

45+
If we press shift+enter on the cell above to run the code, we will see that Python happily ignores the comment. So here (and in future labs), a comment will be provided to indicate what we should see as the return value of our code. When we press shift+enter, and the output below matches the comment to the right of our code, we did it correctly.
4846

47+
> In future labs, Learn will check our code to ensure that we did it correctly. But for our first lab, this works fine.
4948
50-
51-
'hello'
52-
53-
54-
55-
If you press shift+enter to run the code in the cell, you will see that Python happily ignores the comment. So in labs, we provide the comment to indicate what you should see as the return value of your code. When you press shift+enter, and the output below matches the comment to the right of your code, you did it correctly.
56-
57-
> In future labs, Learn will check your code to ensure that you did it correctly. But for your first lab, this works fine.
58-
59-
And change it to the following:
49+
To get our output to match the comment we will change it to the following:
6050

6151

6252
```python
6353
"art vandelay".upper() # 'ART VANDELAY'
6454
```
6555

66-
67-
68-
69-
'ART VANDELAY'
70-
71-
72-
7356
### Get going with strings
7457

7558
First use the `title` method to capitalize the first letter of each word in "art vandelay"`.
@@ -79,83 +62,41 @@ First use the `title` method to capitalize the first letter of each word in "art
7962
"art vandelay" # 'Art Vandelay'
8063
```
8164

82-
83-
84-
85-
'art vandelay'
86-
87-
88-
8965
Now let's uppercase all of the letters of "Ceo".
9066

9167

9268
```python
9369
"Ceo" # 'CEO'
9470
```
9571

96-
97-
98-
99-
'Ceo'
100-
101-
102-
103-
Now write a method that answers a question about our email addresses. Every email address should end with ".com". Use your knowledge of string methods to check if the email address ends with ".com" and return `True` or `False` accordingly.
72+
Next, write a method that answers a question about our email addresses. Every email address should end with ".com". We can use our knowledge of string methods to check if the email address ends with ".com" and return `True` or `False` accordingly.
10473

10574

10675
```python
107-
"art.vandelay@vandelay.cop" # False
76+
"art.vandelay@vandelay.co" # False
10877
```
10978

110-
111-
112-
113-
'art.vandelay@vandelay.cop'
114-
115-
116-
117-
As you can see, the website "vandelay.com" is not preceded by `"www."`. Use the plus sign to change the website 'vandelay.com' to the string `'www.vandelay.com'`.
79+
As you can see below, the website "vandelay.com" is not preceded by `"www."`. We can perform what is called string interpolation to fix this! Use the plus sign, `'+'`, to change the website `'vandelay.com'` to the string `'www.vandelay.com'` by prepending `'www.'`.
11880

11981

12082
```python
12183
'vandelay.com' # 'www.vandelay.com'
12284
```
12385

124-
125-
126-
127-
'vandelay.com'
128-
129-
130-
13186
### Working with numbers
13287

133-
Finally, Mr. Vandelay gave us his phone number, but he actually has a second number different ones listed. All three numbers are the same except for the ending. Coerce the string of his phone number to an `int` and add one, then add two to change the number.
88+
Finally, Mr. Vandelay gave us his phone number, but he actually has two other phone numbers that are different from the one listed. All three numbers are basically the same with the excepion of the ending. Below, start by coercing the first phone number, which is currently a string, to an `int` and add one. Next do the same to the second phone number but increase it by two.
13489

13590

13691
```python
13792
"7285553334" # 7285553335
13893
```
13994

14095

141-
142-
143-
'7285553334'
144-
145-
146-
147-
14896
```python
14997
"7285553334" # 7285553336
15098
```
15199

152-
153-
154-
155-
'7285553334'
156-
157-
158-
159100
### Summary
160101

161-
Your first lab done! Sweet. In this lab, you practiced working with string methods to operate on and answer questions about strings. You wrote methods that return Booleans. And you changed strings to an `int` to then perform addition. So much of working with data, is ensuring that our data is properly formatted so we can then operate on it and in this lab you saw how to use code to just that.
102+
Our first lab is done! Sweet. In this lab, we practiced working with string methods to operate on and answer questions about strings. We wrote methods that return Booleans and changed strings to intergers in order to perform addition. So much of working with data is ensuring that it is properly formatted so we can then operate on it, and in this lab, we saw how to use code to do just that.

index.ipynb

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"source": [
2121
"In the past few lessons, we have learned about working with different types of data in Python: strings, numbers (ints and floats), and booleans. Now let's put that knowledge into action.\n",
2222
"\n",
23-
"In this lesson we'll imagine that at a nice social gathering you exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. You want to use your programming skills to format this information correctly. "
23+
"In this lesson we'll imagine that we were at a nice social gathering and exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. We want to use our programming skills to format this information correctly. "
2424
]
2525
},
2626
{
@@ -43,7 +43,7 @@
4343
"cell_type": "markdown",
4444
"metadata": {},
4545
"source": [
46-
"The next morning you take out the business card, ready to format it using your programming skills, and here is what you find."
46+
"The next morning we take out the business card, ready to format it using our programming skills, and here is what we find."
4747
]
4848
},
4949
{
@@ -66,16 +66,16 @@
6666
"cell_type": "markdown",
6767
"metadata": {},
6868
"source": [
69-
"### Solving your first lab"
69+
"### Solving our first lab"
7070
]
7171
},
7272
{
7373
"cell_type": "markdown",
7474
"metadata": {},
7575
"source": [
76-
"This is your first lab, and here you'll see that we have provided some data for you. Next to the data, you will see a comment indicating what the data should look like after you change it. Let's do the first one together. \n",
76+
"This is our first lab, and here we'll see that there is some data already provided for us. Next to the data, we will see a comment indicating what the data should look like after we change it. Let's do the first one together. \n",
7777
"\n",
78-
"For example, let's say we want to capitalize all of the letters of \"art vandlay\". You'll see the following:"
78+
"For example, let's say we want to capitalize all of the letters of \"art vandlay\". We'll see the following:"
7979
]
8080
},
8181
{
@@ -93,14 +93,14 @@
9393
"cell_type": "markdown",
9494
"metadata": {},
9595
"source": [
96-
"Notice that there is no output below the gray code above. This is because Jupyter notebooks do not automatically run our code - so they do not automatically know the output. To display the output, you must **run** the code by clicking on the gray cell and then pressing shift + enter. Try it above and you will see output below the cell."
96+
"Notice that there is no output below the gray code above. This is because Jupyter notebooks do not automatically run our code - so they do not automatically know the output. To display the output, we must **run** the code by clicking on the gray cell and then pressing shift + enter. Let's try it in the cell above and see our output appear below."
9797
]
9898
},
9999
{
100100
"cell_type": "markdown",
101101
"metadata": {},
102102
"source": [
103-
"Ok, once you see the output take a look at the hash tag to the right of the string. The hash tag to the right is a comment. Comments are used for programmers to annotate their code, but a comment has no impact on the code. See this by running the next cell below (again, press shift + enter)."
103+
"Ok, once we see the output take a look at the hash tag to the right of the string. The hash tag to the right is a comment. Comments are used for programmers to annotate their code, but a comment has no impact on the code. See this by running the next cell below (again, press shift + enter)."
104104
]
105105
},
106106
{
@@ -119,21 +119,21 @@
119119
"cell_type": "markdown",
120120
"metadata": {},
121121
"source": [
122-
"If you press shift+enter on the cell above to run the code, you will see that Python happily ignores the comment. So here (and in future labs), we will provide the comment to indicate what you should see as the return value of your code. When you press shift+enter, and the output below matches the comment to the right of your code, you did it correctly."
122+
"If we press shift+enter on the cell above to run the code, we will see that Python happily ignores the comment. So here (and in future labs), a comment will be provided to indicate what we should see as the return value of our code. When we press shift+enter, and the output below matches the comment to the right of our code, we did it correctly."
123123
]
124124
},
125125
{
126126
"cell_type": "markdown",
127127
"metadata": {},
128128
"source": [
129-
"> In future labs, Learn will check your code to ensure that you did it correctly. But for your first lab, this works fine."
129+
"> In future labs, Learn will check our code to ensure that we did it correctly. But for our first lab, this works fine."
130130
]
131131
},
132132
{
133133
"cell_type": "markdown",
134134
"metadata": {},
135135
"source": [
136-
"To get our output to match comment we will change it to the following:"
136+
"To get our output to match the comment we will change it to the following:"
137137
]
138138
},
139139
{
@@ -194,13 +194,15 @@
194194
"cell_type": "markdown",
195195
"metadata": {},
196196
"source": [
197-
"Next, write a method that answers a question about our email addresses. Every email address should end with \".com\". Use your knowledge of string methods to check if the email address ends with \".com\" and return `True` or `False` accordingly. "
197+
"Next, write a method that answers a question about our email addresses. Every email address should end with \".com\". We can use our knowledge of string methods to check if the email address ends with \".com\" and return `True` or `False` accordingly. "
198198
]
199199
},
200200
{
201201
"cell_type": "code",
202202
"execution_count": null,
203-
"metadata": {},
203+
"metadata": {
204+
"collapsed": true
205+
},
204206
"outputs": [],
205207
"source": [
206208
"\"art.vandelay@vandelay.co\" # False"
@@ -210,7 +212,7 @@
210212
"cell_type": "markdown",
211213
"metadata": {},
212214
"source": [
213-
"As you can see below, the website \"vandelay.com\" is not preceded by `\"www.\"`. We can perform what is called string interpolation to fix this! Use the plus sign, `+`, to change the website `'vandelay.com'` to the string `'www.vandelay.com'` by prepending `'www.'`."
215+
"As you can see below, the website \"vandelay.com\" is not preceded by `\"www.\"`. We can perform what is called string interpolation to fix this! Use the plus sign, `'+'`, to change the website `'vandelay.com'` to the string `'www.vandelay.com'` by prepending `'www.'`."
214216
]
215217
},
216218
{
@@ -236,7 +238,7 @@
236238
"cell_type": "markdown",
237239
"metadata": {},
238240
"source": [
239-
"Finally, Mr. Vandelay gave us his phone number, but he actually has a second phone number that is different from the one listed. All three numbers are basically the same with the excepion of the ending. Below, start by coercing each phone number, which are currently strings, to an `int` and add one to the first and add two to the second to change the numbers."
241+
"Finally, Mr. Vandelay gave us his phone number, but he actually has two other phone numbers that are different from the one listed. All three numbers are basically the same with the excepion of the ending. Below, start by coercing the first phone number, which is currently a string, to an `int` and add one. Next do the same to the second phone number but increase it by two."
240242
]
241243
},
242244
{
@@ -272,7 +274,7 @@
272274
"cell_type": "markdown",
273275
"metadata": {},
274276
"source": [
275-
"Your first lab done! Sweet. In this lab, you practiced working with string methods to operate on and answer questions about strings. You wrote methods that return Booleans and changed strings to intergers in order to perform addition. So much of working with data is ensuring that it is properly formatted so we can then operate on it, and in this lab, you saw how to use code to just that."
277+
"Our first lab is done! Sweet. In this lab, we practiced working with string methods to operate on and answer questions about strings. We wrote methods that return Booleans and changed strings to intergers in order to perform addition. So much of working with data is ensuring that it is properly formatted so we can then operate on it, and in this lab, we saw how to use code to do just that."
276278
]
277279
}
278280
],

0 commit comments

Comments
 (0)