-
-
Notifications
You must be signed in to change notification settings - Fork 780
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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! | ||
> | ||
> ~~~ | ||
|
@@ -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: | ||
|
@@ -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: | ||
> ~~~ | ||
> ~~~ | ||
> sample_ages = [10, 12.5, 'Unknown'] | ||
> ~~~ | ||
{: .callout} | ||
|
@@ -539,4 +539,6 @@ Omitting ending index: ["sep", "oct", "nov", "dec"] | |
> {: .solution} | ||
{: .challenge} | ||
|
||
[hadleywickham-tweet]: https://twitter.com/hadleywickham/status/643381054758363136 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use this link on line 211 as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great catch ! |
||
|
||
{% include links.md %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Was about to add a comment about it :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍