File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "metadata" : {
33 "name" : " " ,
4- "signature" : " sha256:1ea7dc49f946546b6ab2dc4d73a06849f0f6994a0ee6912c4368f0caf20e1f3f "
4+ "signature" : " sha256:2e85a1190fdc5f2a5f5567835384cdf4dc4a717102ea921578a4ee8c4d69eccc "
55 },
66 "nbformat" : 3 ,
77 "nbformat_minor" : 0 ,
353353 " \n " ,
354354 " def translate(sentence):\n " ,
355355 " spanish_words = sentence.split()\n " ,
356- " english_words = [words[w] for w in spanish_words]\n " ,
356+ " english_words = []\n " ,
357+ " for w in spanish_words:\n " ,
358+ " english_words.append(words[w])\n " ,
357359 " return \" \" .join(english_words)"
358360 ],
359361 "language" : " python" ,
360362 "metadata" : {},
361363 "outputs" : [],
362- "prompt_number" : 35
364+ "prompt_number" : 39
363365 },
364366 {
365367 "cell_type" : " code" ,
373375 {
374376 "metadata" : {},
375377 "output_type" : " pyout" ,
376- "prompt_number" : 36 ,
378+ "prompt_number" : 40 ,
377379 "text" : [
378380 " 'the dog ate the burrito green'"
379381 ]
380382 }
381383 ],
382- "prompt_number" : 36
384+ "prompt_number" : 40
383385 },
384386 {
385387 "cell_type" : " code" ,
405407 "cell_type" : " markdown" ,
406408 "metadata" : {},
407409 "source" : [
408- " **Extra Credit:** turn the translate function into a single list comprehension ."
410+ " **Extra Credit:** Try using a list comprehension in the translate function ."
409411 ]
410412 },
411413 {
You can’t perform that action at this time.
0 commit comments