Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add line breaks in _episodes/03-lists #566

Merged
merged 2 commits into from
Jul 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions _episodes/03-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ does not.
> 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 in
> place or a function that returns a modified copy and leaves the original unchanged.
> 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
> 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!
>
> ~~~
Expand Down Expand Up @@ -172,8 +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's tweet about R lists.](../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 @@ -208,13 +208,13 @@ does not.
> ~~~
> {: .output}
>
> Thanks to [Hadley Wickham](https://twitter.com/hadleywickham/status/643381054758363136)
> Thanks to [Hadley Wickham][hadleywickham-tweet]
> for the image above.
{: .callout}

> ## Heterogeneous Lists
> Lists in Python can contain elements of different types. Example:
> ~~~
> ~~~
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

> sample_ages = [10, 12.5, 'Unknown']
> ~~~
{: .callout}
Expand Down Expand Up @@ -539,4 +539,6 @@ Omitting ending index: ["sep", "oct", "nov", "dec"]
> {: .solution}
{: .challenge}

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use this link on line 211 as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch !


{% include links.md %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Was about to add a comment about it :)