You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: part-4.ipynb
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,12 +111,44 @@
111
111
"metadata": {},
112
112
"source": [
113
113
"Note how our list comprehension is written within the brackets: The list we're looping over (my_favorite_numbers) is written at the end whereas the action inside of the for-loop is written first: n * n"
114
+
"Let's compare the two methods real quick by highlighting the different logical parts."
"Look for the <span style=\"background:orange\">new list</span> being created, the <span style=\"background:cyan\">iteration</span> being done over the <span style=\"background:yellowgreen\">orignal list</span> and the <span style=\"background:pink\">transformation</span> being done on each element. List comprehensions are just a cleaner way of building lists from other iterables."
144
+
]
145
+
},
146
+
{
147
+
"cell_type": "markdown",
148
+
"metadata": {},
149
+
"source": [
150
+
"### Improving our work\n",
151
+
"\n",
120
152
"Let's revisit a problem we've already solved in Danny's lecture on lists:\n",
121
153
"\n",
122
154
"Pick every name from a list that begins with a vowel.\n",
0 commit comments