Skip to content

Commit c7907f3

Browse files
committed
stub out variables
1 parent 6513e20 commit c7907f3

File tree

1 file changed

+83
-180
lines changed

1 file changed

+83
-180
lines changed

index.ipynb

Lines changed: 83 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "code",
58-
"execution_count": 2,
58+
"execution_count": 1,
5959
"metadata": {
6060
"collapsed": true
6161
},
@@ -64,6 +64,13 @@
6464
"top_travel_cities = ['Solta', 'Greenville', 'Buenos Aires', 'Los Cabos', 'Walla Walla Valley', 'Marakesh', 'Albuquerque', 'Archipelago Sea', 'Iguazu Falls', 'Salina Island', 'Toronto', 'Pyeongchang']"
6565
]
6666
},
67+
{
68+
"cell_type": "markdown",
69+
"metadata": {},
70+
"source": [
71+
"> Remember to press shift enter to run each gray block of code."
72+
]
73+
},
6774
{
6875
"cell_type": "markdown",
6976
"metadata": {},
@@ -73,8 +80,10 @@
7380
},
7481
{
7582
"cell_type": "code",
76-
"execution_count": 1,
77-
"metadata": {},
83+
"execution_count": 2,
84+
"metadata": {
85+
"collapsed": true
86+
},
7887
"outputs": [],
7988
"source": [
8089
"countries = ['Croatia',\n",
@@ -109,36 +118,33 @@
109118
"cell_type": "markdown",
110119
"metadata": {},
111120
"source": [
112-
"First, access the third to last element and set it equal to the variable `italy`."
121+
"First, access the third to last element from `countries` and set it equal to the variable `italy`."
113122
]
114123
},
115124
{
116125
"cell_type": "code",
117-
"execution_count": 10,
126+
"execution_count": 5,
118127
"metadata": {
119128
"collapsed": true
120129
},
121130
"outputs": [],
122131
"source": [
123-
"italy = countries[-3] # 'Italy'"
132+
"italy = None # 'Italy'\n",
133+
"italy"
134+
]
135+
},
136+
{
137+
"cell_type": "markdown",
138+
"metadata": {},
139+
"source": [
140+
"> We assign the varible `italy` equal to `None`, but you should change the word `None` to code that uses the `countries` list to assign `italy` to `'Italy'`."
124141
]
125142
},
126143
{
127144
"cell_type": "code",
128-
"execution_count": 11,
129-
"metadata": {},
130-
"outputs": [
131-
{
132-
"data": {
133-
"text/plain": [
134-
"'Italy'"
135-
]
136-
},
137-
"execution_count": 11,
138-
"metadata": {},
139-
"output_type": "execute_result"
140-
}
141-
],
145+
"execution_count": 19,
146+
"metadata": {},
147+
"outputs": [],
142148
"source": [
143149
"italy # 'Italy'"
144150
]
@@ -152,23 +158,11 @@
152158
},
153159
{
154160
"cell_type": "code",
155-
"execution_count": 13,
156-
"metadata": {},
157-
"outputs": [
158-
{
159-
"data": {
160-
"text/plain": [
161-
"'Mexico'"
162-
]
163-
},
164-
"execution_count": 13,
165-
"metadata": {},
166-
"output_type": "execute_result"
167-
}
168-
],
169-
"source": [
170-
"mexico = countries[3]\n",
171-
"\n",
161+
"execution_count": 20,
162+
"metadata": {},
163+
"outputs": [],
164+
"source": [
165+
"mexico = None\n",
172166
"mexico"
173167
]
174168
},
@@ -181,22 +175,11 @@
181175
},
182176
{
183177
"cell_type": "code",
184-
"execution_count": 16,
185-
"metadata": {},
186-
"outputs": [
187-
{
188-
"data": {
189-
"text/plain": [
190-
"['USA', 'Argentina', 'Mexico', 'USA']"
191-
]
192-
},
193-
"execution_count": 16,
194-
"metadata": {},
195-
"output_type": "execute_result"
196-
}
197-
],
198-
"source": [
199-
"kindof_neighbors = countries[1:5]\n",
178+
"execution_count": 21,
179+
"metadata": {},
180+
"outputs": [],
181+
"source": [
182+
"kindof_neighbors = None\n",
200183
"kindof_neighbors"
201184
]
202185
},
@@ -211,60 +194,46 @@
211194
"cell_type": "markdown",
212195
"metadata": {},
213196
"source": [
214-
"Ok, now let's add a couple of countries onto this list. At the end of the list add the country 'Malta', followed by the country 'Thailand'."
197+
"Ok, now let's add a couple of countries onto this list. At the end of the list, add the country 'Malta'."
215198
]
216199
},
217200
{
218201
"cell_type": "code",
219-
"execution_count": 18,
220-
"metadata": {
221-
"collapsed": true
222-
},
202+
"execution_count": 24,
203+
"metadata": {},
223204
"outputs": [],
224205
"source": [
225-
"countries.append('Malta')"
206+
"None # add code here"
207+
]
208+
},
209+
{
210+
"cell_type": "markdown",
211+
"metadata": {},
212+
"source": [
213+
"Then add the country 'Thailand'."
226214
]
227215
},
228216
{
229217
"cell_type": "code",
230-
"execution_count": 19,
231-
"metadata": {
232-
"collapsed": true
233-
},
218+
"execution_count": 25,
219+
"metadata": {},
234220
"outputs": [],
235221
"source": [
236-
"countries.append('Thailand')"
222+
"None # add code here"
223+
]
224+
},
225+
{
226+
"cell_type": "markdown",
227+
"metadata": {},
228+
"source": [
229+
"Now your list of countries should look like the following."
237230
]
238231
},
239232
{
240233
"cell_type": "code",
241-
"execution_count": 22,
242-
"metadata": {},
243-
"outputs": [
244-
{
245-
"data": {
246-
"text/plain": [
247-
"['Croatia',\n",
248-
" 'USA',\n",
249-
" 'Argentina',\n",
250-
" 'Mexico',\n",
251-
" 'USA',\n",
252-
" 'Morocco',\n",
253-
" 'New Mexico',\n",
254-
" 'Finland',\n",
255-
" 'Argentina',\n",
256-
" 'Italy',\n",
257-
" 'Canada',\n",
258-
" 'South Korea',\n",
259-
" 'Malta',\n",
260-
" 'Thailand']"
261-
]
262-
},
263-
"execution_count": 22,
264-
"metadata": {},
265-
"output_type": "execute_result"
266-
}
267-
],
234+
"execution_count": null,
235+
"metadata": {},
236+
"outputs": [],
268237
"source": [
269238
"countries \n",
270239
"# ['Croatia', 'USA', 'Argentina', 'Mexico', 'USA', 'Morocco', 'New Mexico', 'Finland', \n",
@@ -275,49 +244,23 @@
275244
"cell_type": "markdown",
276245
"metadata": {},
277246
"source": [
278-
"Now you may have notice that \"New Mexico\" is included in our list of countries. That doesn't seem right. Let's change 'New Mexico' to 'USA'."
247+
"You may have noticed that \"New Mexico\" is included in our list of countries. That doesn't seem right. Let's change 'New Mexico' to 'USA'."
279248
]
280249
},
281250
{
282251
"cell_type": "code",
283-
"execution_count": 24,
284-
"metadata": {
285-
"collapsed": true
286-
},
252+
"execution_count": 30,
253+
"metadata": {},
287254
"outputs": [],
288255
"source": [
289-
"countries[6] = 'USA'"
256+
"None # add code here"
290257
]
291258
},
292259
{
293260
"cell_type": "code",
294-
"execution_count": 26,
295-
"metadata": {},
296-
"outputs": [
297-
{
298-
"data": {
299-
"text/plain": [
300-
"['Croatia',\n",
301-
" 'USA',\n",
302-
" 'Argentina',\n",
303-
" 'Mexico',\n",
304-
" 'USA',\n",
305-
" 'Morocco',\n",
306-
" 'USA',\n",
307-
" 'Finland',\n",
308-
" 'Argentina',\n",
309-
" 'Italy',\n",
310-
" 'Canada',\n",
311-
" 'South Korea',\n",
312-
" 'Malta',\n",
313-
" 'Thailand']"
314-
]
315-
},
316-
"execution_count": 26,
317-
"metadata": {},
318-
"output_type": "execute_result"
319-
}
320-
],
261+
"execution_count": null,
262+
"metadata": {},
263+
"outputs": [],
321264
"source": [
322265
"countries \n",
323266
"# ['Croatia', 'USA', 'Argentina', 'Mexico', 'USA', 'Morocco', 'USA', 'Finland', \n",
@@ -333,20 +276,9 @@
333276
},
334277
{
335278
"cell_type": "code",
336-
"execution_count": 36,
337-
"metadata": {},
338-
"outputs": [
339-
{
340-
"data": {
341-
"text/plain": [
342-
"'Thailand'"
343-
]
344-
},
345-
"execution_count": 36,
346-
"metadata": {},
347-
"output_type": "execute_result"
348-
}
349-
],
279+
"execution_count": null,
280+
"metadata": {},
281+
"outputs": [],
350282
"source": [
351283
"countries = ['Croatia',\n",
352284
" 'USA',\n",
@@ -362,7 +294,9 @@
362294
" 'South Korea', \n",
363295
" 'Malta', \n",
364296
" 'Thailand']\n",
365-
"countries.pop() # 'Thailand'"
297+
"countries.pop() # 'Thailand'\n",
298+
"countries\n",
299+
"# ['Croatia', 'USA', 'Argentina', 'Mexico', 'USA', 'Morocco', 'USA', 'Finland', 'Argentina', 'Italy', 'Canada', 'South Korea', 'Malta']"
366300
]
367301
},
368302
{
@@ -388,40 +322,20 @@
388322
},
389323
{
390324
"cell_type": "code",
391-
"execution_count": 37,
325+
"execution_count": 32,
392326
"metadata": {
393327
"collapsed": true
394328
},
395329
"outputs": [],
396330
"source": [
397-
"unique_countries = list(set(countries))"
331+
"unique_countries = None"
398332
]
399333
},
400334
{
401335
"cell_type": "code",
402-
"execution_count": 38,
403-
"metadata": {},
404-
"outputs": [
405-
{
406-
"data": {
407-
"text/plain": [
408-
"['USA',\n",
409-
" 'South Korea',\n",
410-
" 'Morocco',\n",
411-
" 'Finland',\n",
412-
" 'Italy',\n",
413-
" 'Mexico',\n",
414-
" 'Argentina',\n",
415-
" 'Malta',\n",
416-
" 'Croatia',\n",
417-
" 'Canada']"
418-
]
419-
},
420-
"execution_count": 38,
421-
"metadata": {},
422-
"output_type": "execute_result"
423-
}
424-
],
336+
"execution_count": 33,
337+
"metadata": {},
338+
"outputs": [],
425339
"source": [
426340
"unique_countries # ['USA', 'South Korea', 'Morocco', 'Finland', 'Italy', \n",
427341
"# 'Mexico', 'Argentina', 'Malta', 'Croatia', 'New Mexico', 'Canada']"
@@ -436,22 +350,11 @@
436350
},
437351
{
438352
"cell_type": "code",
439-
"execution_count": 43,
440-
"metadata": {},
441-
"outputs": [
442-
{
443-
"data": {
444-
"text/plain": [
445-
"3"
446-
]
447-
},
448-
"execution_count": 43,
449-
"metadata": {},
450-
"output_type": "execute_result"
451-
}
452-
],
453-
"source": [
454-
"num_of_repeats = len(countries) - len(unique_countries) \n",
353+
"execution_count": 31,
354+
"metadata": {},
355+
"outputs": [],
356+
"source": [
357+
"num_of_repeats = None\n",
455358
"num_of_repeats # 3"
456359
]
457360
},

0 commit comments

Comments
 (0)