|
68 | 68 | "cell_type": "markdown",
|
69 | 69 | "metadata": {},
|
70 | 70 | "source": [
|
71 |
| - "> Remember to press shift enter to run each gray block of code." |
| 71 | + "> Remember to press shift+enter to run each gray block of code. Otherwise, the variables will not be defined." |
72 | 72 | ]
|
73 | 73 | },
|
74 | 74 | {
|
75 | 75 | "cell_type": "markdown",
|
76 | 76 | "metadata": {},
|
77 | 77 | "source": [
|
78 |
| - "In this lesson we can work with a list of each associated countries for each of those travel cities." |
| 78 | + "In this lesson we can work with a list of associated countries corresponding to each of the top travel cities." |
79 | 79 | ]
|
80 | 80 | },
|
81 | 81 | {
|
|
100 | 100 | " 'South Korea']"
|
101 | 101 | ]
|
102 | 102 | },
|
| 103 | + { |
| 104 | + "cell_type": "markdown", |
| 105 | + "metadata": {}, |
| 106 | + "source": [ |
| 107 | + "> Make sure you run the code in the cell above by pressing shift + enter." |
| 108 | + ] |
| 109 | + }, |
103 | 110 | {
|
104 | 111 | "cell_type": "markdown",
|
105 | 112 | "metadata": {},
|
|
118 | 125 | "cell_type": "markdown",
|
119 | 126 | "metadata": {},
|
120 | 127 | "source": [
|
121 |
| - "First, access the third to last element from `countries` and set it equal to the variable `italy`." |
| 128 | + "First, set the variable `italy` to be equal to the third to last element from `countries`. \n", |
| 129 | + ">**Note:** If you see an **error** stating that `countries` is undefined, it means you must press shift+enter in the second gray box where `countries` variable is assigned." |
122 | 130 | ]
|
123 | 131 | },
|
124 | 132 | {
|
|
137 | 145 | "cell_type": "markdown",
|
138 | 146 | "metadata": {},
|
139 | 147 | "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'`." |
| 148 | + "> 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'`. We wrote the variable `italy` a second time, so that you can see what it equals when you run the code block. Currently, nothing is displayed below as it equals `None`, but when it's correct it will match the string which is commented out, `'Italy'`." |
141 | 149 | ]
|
142 | 150 | },
|
143 | 151 | {
|
144 | 152 | "cell_type": "code",
|
145 | 153 | "execution_count": 19,
|
146 |
| - "metadata": {}, |
| 154 | + "metadata": { |
| 155 | + "collapsed": true |
| 156 | + }, |
147 | 157 | "outputs": [],
|
148 | 158 | "source": [
|
149 | 159 | "italy # 'Italy'"
|
|
159 | 169 | {
|
160 | 170 | "cell_type": "code",
|
161 | 171 | "execution_count": 20,
|
162 |
| - "metadata": {}, |
| 172 | + "metadata": { |
| 173 | + "collapsed": true |
| 174 | + }, |
163 | 175 | "outputs": [],
|
164 | 176 | "source": [
|
165 | 177 | "mexico = None\n",
|
|
176 | 188 | {
|
177 | 189 | "cell_type": "code",
|
178 | 190 | "execution_count": 21,
|
179 |
| - "metadata": {}, |
| 191 | + "metadata": { |
| 192 | + "collapsed": true |
| 193 | + }, |
180 | 194 | "outputs": [],
|
181 | 195 | "source": [
|
182 | 196 | "kindof_neighbors = None\n",
|
|
200 | 214 | {
|
201 | 215 | "cell_type": "code",
|
202 | 216 | "execution_count": 24,
|
203 |
| - "metadata": {}, |
| 217 | + "metadata": { |
| 218 | + "collapsed": true |
| 219 | + }, |
204 | 220 | "outputs": [],
|
205 | 221 | "source": [
|
206 | 222 | "None # add code here"
|
|
216 | 232 | {
|
217 | 233 | "cell_type": "code",
|
218 | 234 | "execution_count": 25,
|
219 |
| - "metadata": {}, |
| 235 | + "metadata": { |
| 236 | + "collapsed": true |
| 237 | + }, |
220 | 238 | "outputs": [],
|
221 | 239 | "source": [
|
222 | 240 | "None # add code here"
|
|
232 | 250 | {
|
233 | 251 | "cell_type": "code",
|
234 | 252 | "execution_count": null,
|
235 |
| - "metadata": {}, |
| 253 | + "metadata": { |
| 254 | + "collapsed": true |
| 255 | + }, |
236 | 256 | "outputs": [],
|
237 | 257 | "source": [
|
238 | 258 | "countries \n",
|
|
250 | 270 | {
|
251 | 271 | "cell_type": "code",
|
252 | 272 | "execution_count": 30,
|
253 |
| - "metadata": {}, |
| 273 | + "metadata": { |
| 274 | + "collapsed": true |
| 275 | + }, |
254 | 276 | "outputs": [],
|
255 | 277 | "source": [
|
256 | 278 | "None # add code here"
|
|
259 | 281 | {
|
260 | 282 | "cell_type": "code",
|
261 | 283 | "execution_count": null,
|
262 |
| - "metadata": {}, |
| 284 | + "metadata": { |
| 285 | + "collapsed": true |
| 286 | + }, |
263 | 287 | "outputs": [],
|
264 | 288 | "source": [
|
265 | 289 | "countries \n",
|
|
277 | 301 | {
|
278 | 302 | "cell_type": "code",
|
279 | 303 | "execution_count": null,
|
280 |
| - "metadata": {}, |
| 304 | + "metadata": { |
| 305 | + "collapsed": true |
| 306 | + }, |
281 | 307 | "outputs": [],
|
282 | 308 | "source": [
|
283 | 309 | "countries = ['Croatia',\n",
|
|
334 | 360 | {
|
335 | 361 | "cell_type": "code",
|
336 | 362 | "execution_count": 33,
|
337 |
| - "metadata": {}, |
| 363 | + "metadata": { |
| 364 | + "collapsed": true |
| 365 | + }, |
338 | 366 | "outputs": [],
|
339 | 367 | "source": [
|
340 | 368 | "unique_countries # ['USA', 'South Korea', 'Morocco', 'Finland', 'Italy', \n",
|
|
351 | 379 | {
|
352 | 380 | "cell_type": "code",
|
353 | 381 | "execution_count": 31,
|
354 |
| - "metadata": {}, |
| 382 | + "metadata": { |
| 383 | + "collapsed": true |
| 384 | + }, |
355 | 385 | "outputs": [],
|
356 | 386 | "source": [
|
357 | 387 | "num_of_repeats = None\n",
|
|
371 | 401 | "collapsed": true
|
372 | 402 | },
|
373 | 403 | "source": [
|
374 |
| - "In this section we saw how to get our data from the outside world and into Python. The purpose isn't to understand all of this code right now, but rather to see how easily we can start working with outside data. As we become better at Python, the usefulness of taking data and operating on it in code rather than a spreadsheet will become more apparent. But that doesn't mean we can't get step outside of Python sandbox now. It's not too difficult to take some data we may already have, and begin to use it with Python. In the next section, we'll use a lab to get data from excel and work with lists." |
| 404 | + "In this section we saw how to get our data from the outside world and into Python. The purpose isn't to understand all of this code right now, but rather to see how easily we can start working with outside data. As we become better at Python, the usefulness of taking data and operating on it in code rather than a spreadsheet will become more apparent. But that doesn't mean we can't get step outside of the Python sandbox now. It's not too difficult to take some data we may already have, and begin to use it with Python. In the next section, we'll use a lab to get data from excel and work with lists." |
375 | 405 | ]
|
376 | 406 | }
|
377 | 407 | ],
|
|
0 commit comments