Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
emdupre committed Jul 17, 2018
1 parent 99956d7 commit a3352a2
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions _episodes/03-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,17 @@ does not.
>
> Data which can be modified in place is called [mutable]({{ page.root }}/reference/#mutable),
> while data which cannot be modified is called [immutable]({{ page.root }}/reference/#immutable).
> Strings and numbers are immutable.
> This does not mean that variables with string or number values are constants,
> but when we want to change the value of a string or number variable, we can only
> Strings and numbers are immutable. This does not mean that variables with string or number values
> are constants, but when we want to change the value of a string or number variable, we can only
> replace the old value with a completely new value.
>
> Lists and arrays, on the other hand, are mutable: we can modify them after they have been created.
> We can change individual elements, append new elements, or reorder the whole list.
> For some operations, like sorting, we can choose whether to use a function that modifies the data
> Lists and arrays, on the other hand, are mutable: we can modify them after they have been
> created. We can change individual elements, append new elements, or reorder the whole list. For
> some operations, like sorting, we can choose whether to use a function that modifies the data
> in-place or a function that returns a modified copy and leaves the original unchanged.
>
> Be careful when modifying data in-place.
> If two variables refer to the same list, and you modify the list value,
> it will change for both variables!
> Be careful when modifying data in-place. If two variables refer to the same list, and you modify
> the list value, it will change for both variables!
>
> ~~~
> salsa = ['peppers', 'onions', 'cilantro', 'tomatoes']
Expand Down Expand Up @@ -174,9 +172,8 @@ does not.
>
> Here is a visual example of how indexing a list of lists `x` works:
>
> <a href='https://twitter.com/hadleywickham/status/643381054758363136'>
> ![The first element of a list. Adapted from @hadleywickham.](../fig/indexing_lists_python.png)
> </a>
> [![The first element of a list.
> Adapted from @hadleywickham.](../fig/indexing_lists_python.png)][hadleywickham-tweet]
>
> Using the previously declared list `x`, these would be the results of the
> index operations shown in the image:
Expand Down Expand Up @@ -211,7 +208,7 @@ does not.
> ~~~
> {: .output}
>
> Thanks to [Hadley Wickham](https://twitter.com/hadleywickham/status/643381054758363136)
> Thanks to [Hadley Wickham][hadleywickham-tweet]
> for the image above.
{: .callout}

Expand Down Expand Up @@ -542,4 +539,6 @@ Omitting ending index: ["sep", "oct", "nov", "dec"]
> {: .solution}
{: .challenge}

[hadleywickham-tweet]: https://twitter.com/hadleywickham/status/643381054758363136

{% include links.md %}

0 comments on commit a3352a2

Please sign in to comment.