Skip to content

Commit 65d5fdb

Browse files
committed
Added example
Added Python output for example of what veg[2] would contain
1 parent 895b99a commit 65d5fdb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

_episodes/04-lists.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ does not.
179179
>
180180
> Here are some visual examples of how indexing a list of lists `veg` works. First,
181181
> you can reference each row on the shelf as a separate list. For example, `veg[2]`
182-
> represents the bottom row, which is a list of the baskets in that row.
182+
> represents the bottom row, which is a list of the baskets in that row:
183+
>
184+
> ~~~
185+
> veg[2] = ['lettuce', 'lettuce', 'peppers', 'zucchini']
186+
> ~~~
187+
> {: .language-python}
183188
>
184189
> ![`veg` is now shown as a list of three rows, with `veg[0]` representing the top row of
185190
> three baskets, `veg[1]` representing the second row, and `veg[2]` representing the bottom row.](../fig/04_groceries_veg0.png)

0 commit comments

Comments
 (0)