Skip to content

Commit d6756f4

Browse files
committed
fix conflicts
2 parents ab1b4c5 + 12c1eaa commit d6756f4

File tree

2 files changed

+22
-57
lines changed

2 files changed

+22
-57
lines changed

README.md

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
# Introduction to lists
33

4-
So far we have worked with individual pieces of data like the string `hello`, then with variables we saw how to give this data a name with variables. Well in this lesson, we'll see how we can group data together with lists.
4+
So far we have worked with individual pieces of data like the string `hello`, then with variables we saw how to give this data a name. Well, in this lesson, we'll see how we can group data together with lists.
55

66
### Creating a list
77

8-
A list is our first form of a collection. A collection is just a way of grouping data together, and lists certainly accomplish this. For example, let's consider the top cities to travel to according to Travel and Leisure. We'll see it below, but we must stay focused on Python and data!
8+
A list is our first form of a collection. A collection is just a way of grouping data together, and lists certainly accomplish this. For example, let's consider the top cities to travel to according to Travel and Leisure. We'll see it below, but we must stay focused on Python and data! Here is how we are used to seeing a list of travel locations in a document or on a website.
99

1010
#### Travel Locations
1111
1. Solta
@@ -21,7 +21,7 @@ A list is our first form of a collection. A collection is just a way of groupin
2121
11. Toronto
2222
12. Pyeongchang
2323

24-
Ok, and this is how we express this in Python.
24+
And here is how that same list looks in Python:
2525

2626

2727
```python
@@ -46,7 +46,7 @@ Ok, and this is how we express this in Python.
4646

4747

4848

49-
So we indicate that we are initializing a `list` by placing a bracket, `[` (located above of the return key), and end the list with a closing bracket `']'`. To separate each item in the list, called an element, we place a comma.
49+
So we indicate that we are initializing a `list` by placing a bracket, `[`, and end the list with a closing bracket `']'`. To separate each list item, called an element, we place a comma.
5050

5151

5252
```python
@@ -108,7 +108,7 @@ countries_of_top_cities = ['Croatia', 'USA', 'Argentina', 'Mexico', 'USA', 'Moro
108108

109109
### Accessing Elements of Lists
110110

111-
Now our `top_travel_cities` list is contains multiple elements. And just like we numbered the elements of a list with text:
111+
Now our `top_travel_cities` list contains multiple elements. And just like we numbered the elements of a list with text:
112112

113113
1. Solta
114114
2. Greenville
@@ -167,7 +167,7 @@ top_travel_cities[2]
167167

168168

169169

170-
How would we access the last element, well we could count all of the elements in the list, and `Pyeongchang` would just be one less than that. Or we can ask Python to start from the back in move back one.
170+
How would we access the last element? Well, we could count all of the elements in the list, and `Pyeongchang` would just be one less than that. Or we can ask Python to start from the back in move back one.
171171

172172

173173
```python
@@ -415,25 +415,7 @@ top_travel_cities.append('San Antonio')
415415
top_travel_cities
416416
```
417417

418-
419-
420-
421-
['Solta',
422-
'Greenville',
423-
'Buenos Aires',
424-
'Los Cabos',
425-
'Walla Walla Valley',
426-
'Marakesh',
427-
'Albuquerque',
428-
'Archipelago Sea',
429-
'Iguazu Falls',
430-
'Salina Island',
431-
'Toronto',
432-
'Pyeongchang',
433-
'San Antonio',
434-
'San Antonio']
435-
436-
418+
The `pop` method is available to call on any list, and removes the last element from the list. As you can see below, calling `pop` removed our last element.
437419

438420

439421
```python

index.ipynb

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"cell_type": "markdown",
1414
"metadata": {},
1515
"source": [
16-
"So far we have worked with individual pieces of data like the string `hello`, then with variables we saw how to give this data a name with variables. Well in this lesson, we'll see how we can group data together with lists. "
16+
"So far we have worked with individual pieces of data like the string `hello`, then with variables we saw how to give this data a name. Well, in this lesson, we'll see how we can group data together with lists. "
1717
]
1818
},
1919
{
@@ -27,7 +27,7 @@
2727
"cell_type": "markdown",
2828
"metadata": {},
2929
"source": [
30-
"A list is our first form of a collection. A collection is just a way of grouping data together, and lists certainly accomplish this. For example, let's consider the top cities to travel to according to Travel and Leisure. We'll see it below, but we must stay focused on Python and data! "
30+
"A list is our first form of a collection. A collection is just a way of grouping data together, and lists certainly accomplish this. For example, let's consider the top cities to travel to according to Travel and Leisure. We'll see it below, but we must stay focused on Python and data! Here is how we are used to seeing a list of travel locations in a document or on a website."
3131
]
3232
},
3333
{
@@ -53,7 +53,7 @@
5353
"cell_type": "markdown",
5454
"metadata": {},
5555
"source": [
56-
"Ok, and this is how we express this in Python."
56+
"And here is how that same list looks in Python:"
5757
]
5858
},
5959
{
@@ -91,7 +91,7 @@
9191
"cell_type": "markdown",
9292
"metadata": {},
9393
"source": [
94-
"So we indicate that we are initializing a `list` by placing a bracket, `[` (located above of the return key), and end the list with a closing bracket `']'`. To separate each item in the list, called an element, we place a comma."
94+
"So we indicate that we are initializing a `list` by placing a bracket, `[`, and end the list with a closing bracket `']'`. To separate each list item, called an element, we place a comma."
9595
]
9696
},
9797
{
@@ -196,7 +196,7 @@
196196
"cell_type": "markdown",
197197
"metadata": {},
198198
"source": [
199-
"Now our `top_travel_cities` list is contains multiple elements. And just like we numbered the elements of a list with text:\n",
199+
"Now our `top_travel_cities` list contains multiple elements. And just like we numbered the elements of a list with text:\n",
200200
"\n",
201201
"1. Solta\n",
202202
"2. Greenville\n",
@@ -294,7 +294,7 @@
294294
"cell_type": "markdown",
295295
"metadata": {},
296296
"source": [
297-
"How would we access the last element, well we could count all of the elements in the list, and `Pyeongchang` would just be one less than that. Or we can ask Python to start from the back in move back one."
297+
"How would we access the last element? Well, we could count all of the elements in the list, and `Pyeongchang` would just be one less than that. Or we can ask Python to start from the back in move back one."
298298
]
299299
},
300300
{
@@ -724,38 +724,21 @@
724724
},
725725
{
726726
"cell_type": "code",
727-
"execution_count": 97,
727+
"execution_count": null,
728728
"metadata": {},
729-
"outputs": [
730-
{
731-
"data": {
732-
"text/plain": [
733-
"['Solta',\n",
734-
" 'Greenville',\n",
735-
" 'Buenos Aires',\n",
736-
" 'Los Cabos',\n",
737-
" 'Walla Walla Valley',\n",
738-
" 'Marakesh',\n",
739-
" 'Albuquerque',\n",
740-
" 'Archipelago Sea',\n",
741-
" 'Iguazu Falls',\n",
742-
" 'Salina Island',\n",
743-
" 'Toronto',\n",
744-
" 'Pyeongchang',\n",
745-
" 'San Antonio',\n",
746-
" 'San Antonio']"
747-
]
748-
},
749-
"execution_count": 97,
750-
"metadata": {},
751-
"output_type": "execute_result"
752-
}
753-
],
729+
"outputs": [],
754730
"source": [
755731
"top_travel_cities.append('San Antonio')\n",
756732
"top_travel_cities"
757733
]
758734
},
735+
{
736+
"cell_type": "markdown",
737+
"metadata": {},
738+
"source": [
739+
"The `pop` method is available to call on any list, and removes the last element from the list. As you can see below, calling `pop` removed our last element."
740+
]
741+
},
759742
{
760743
"cell_type": "code",
761744
"execution_count": 98,

0 commit comments

Comments
 (0)