|
1 | 1 | { |
2 | 2 | "metadata": { |
3 | 3 | "name": "", |
4 | | - "signature": "sha256:438a503ded59b13e7295fbf00a26fef4b584f4309f97d9e2a2ab45c4b291eabf" |
| 4 | + "signature": "sha256:6d49e8f391efd616a50a4c712a7081065abec4b33a013ba183f59e755696f1f5" |
5 | 5 | }, |
6 | 6 | "nbformat": 3, |
7 | 7 | "nbformat_minor": 0, |
|
217 | 217 | ], |
218 | 218 | "language": "python", |
219 | 219 | "metadata": {}, |
220 | | - "outputs": [], |
221 | | - "prompt_number": 20 |
| 220 | + "outputs": [] |
222 | 221 | }, |
223 | 222 | { |
224 | 223 | "cell_type": "code", |
|
228 | 227 | ], |
229 | 228 | "language": "python", |
230 | 229 | "metadata": {}, |
231 | | - "outputs": [ |
232 | | - { |
233 | | - "metadata": {}, |
234 | | - "output_type": "pyout", |
235 | | - "prompt_number": 21, |
236 | | - "text": [ |
237 | | - "'cat'" |
238 | | - ] |
239 | | - } |
240 | | - ], |
241 | | - "prompt_number": 21 |
| 230 | + "outputs": [] |
242 | 231 | }, |
243 | 232 | { |
244 | 233 | "cell_type": "markdown", |
|
255 | 244 | ], |
256 | 245 | "language": "python", |
257 | 246 | "metadata": {}, |
258 | | - "outputs": [ |
259 | | - { |
260 | | - "metadata": {}, |
261 | | - "output_type": "pyout", |
262 | | - "prompt_number": 22, |
263 | | - "text": [ |
264 | | - "True" |
265 | | - ] |
266 | | - } |
267 | | - ], |
268 | | - "prompt_number": 22 |
| 247 | + "outputs": [] |
269 | 248 | }, |
270 | 249 | { |
271 | 250 | "cell_type": "markdown", |
|
282 | 261 | ], |
283 | 262 | "language": "python", |
284 | 263 | "metadata": {}, |
285 | | - "outputs": [ |
286 | | - { |
287 | | - "metadata": {}, |
288 | | - "output_type": "pyout", |
289 | | - "prompt_number": 23, |
290 | | - "text": [ |
291 | | - "6" |
292 | | - ] |
293 | | - } |
294 | | - ], |
295 | | - "prompt_number": 23 |
| 264 | + "outputs": [] |
296 | 265 | }, |
297 | 266 | { |
298 | 267 | "cell_type": "markdown", |
|
311 | 280 | ], |
312 | 281 | "language": "python", |
313 | 282 | "metadata": {}, |
314 | | - "outputs": [ |
315 | | - { |
316 | | - "metadata": {}, |
317 | | - "output_type": "pyout", |
318 | | - "prompt_number": 24, |
319 | | - "text": [ |
320 | | - "['el', 'gato', 'esta', 'en', 'la', 'casa']" |
321 | | - ] |
322 | | - } |
323 | | - ], |
324 | | - "prompt_number": 24 |
| 283 | + "outputs": [] |
325 | 284 | }, |
326 | 285 | { |
327 | 286 | "cell_type": "markdown", |
328 | 287 | "metadata": {}, |
329 | 288 | "source": [ |
330 | | - "Let's loop over each word in the list and translate each one by using a list comprehension." |
| 289 | + "Let's translate each word and save them in the list called translated_words. We'll generate this list by using a list comprehension." |
331 | 290 | ] |
332 | 291 | }, |
333 | 292 | { |
|
352 | 311 | ] |
353 | 312 | } |
354 | 313 | ], |
355 | | - "prompt_number": 28 |
| 314 | + "prompt_number": 29 |
356 | 315 | }, |
357 | 316 | { |
358 | 317 | "cell_type": "code", |
359 | 318 | "collapsed": false, |
360 | 319 | "input": [ |
361 | | - "for spanish_word in sentence_words:\n", |
362 | | - " print(words[spanish_word])" |
| 320 | + "translated_words" |
363 | 321 | ], |
364 | 322 | "language": "python", |
365 | 323 | "metadata": {}, |
366 | 324 | "outputs": [ |
367 | 325 | { |
368 | | - "output_type": "stream", |
369 | | - "stream": "stdout", |
| 326 | + "metadata": {}, |
| 327 | + "output_type": "pyout", |
| 328 | + "prompt_number": 31, |
370 | 329 | "text": [ |
371 | | - "the\n", |
372 | | - "cat\n", |
373 | | - "is\n", |
374 | | - "in\n", |
375 | | - "the\n", |
376 | | - "house\n" |
| 330 | + "['the', 'cat', 'is', 'in', 'the', 'house']" |
377 | 331 | ] |
378 | 332 | } |
379 | 333 | ], |
380 | | - "prompt_number": 25 |
381 | | - }, |
382 | | - { |
383 | | - "cell_type": "markdown", |
384 | | - "metadata": {}, |
385 | | - "source": [ |
386 | | - "Now let's make a list from the translated words." |
387 | | - ] |
388 | | - }, |
389 | | - { |
390 | | - "cell_type": "code", |
391 | | - "collapsed": false, |
392 | | - "input": [ |
393 | | - "translated_words = []\n", |
394 | | - "for spanish_word in sentence_words:\n", |
395 | | - " translated_words.append(words[spanish_word])\n", |
396 | | - "\n", |
397 | | - "translated_words" |
398 | | - ], |
399 | | - "language": "python", |
400 | | - "metadata": {}, |
401 | | - "outputs": [] |
| 334 | + "prompt_number": 31 |
402 | 335 | }, |
403 | 336 | { |
404 | 337 | "cell_type": "markdown", |
|
416 | 349 | ], |
417 | 350 | "language": "python", |
418 | 351 | "metadata": {}, |
419 | | - "outputs": [] |
| 352 | + "outputs": [ |
| 353 | + { |
| 354 | + "metadata": {}, |
| 355 | + "output_type": "pyout", |
| 356 | + "prompt_number": 32, |
| 357 | + "text": [ |
| 358 | + "'the cat is in the house'" |
| 359 | + ] |
| 360 | + } |
| 361 | + ], |
| 362 | + "prompt_number": 32 |
420 | 363 | }, |
421 | 364 | { |
422 | 365 | "cell_type": "markdown", |
|
0 commit comments