-
-
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
Slicing Exercise (for instructor training checkout) #184
Slicing Exercise (for instructor training checkout) #184
Conversation
…e to confirm the learner's understanding of slicing and negative indexing. Follow-up exercises could be written to further test understanding of step sizes and empty start/stop positions.
> my_list = [] | ||
> ~~~ | ||
|
||
Subsets of lists and strings can be accessed by specifying ranges of values in brackets, similar to how we accessed ranges of positions in a Numpy matrix. This is commonly referred to as "slicing" the list/string. |
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.
Currently, our convention is to have all of the lesson material first, then all of the challenges at the end. Could you move this new material up so that it appears before the challenges?
Also (this is much more nit-picky), could you add some line breaks here? We currently don't do this very consistently, but in most of our .md
files, we have newlines either after a certain number of characters, or when it makes sense for the sentence (see this blog post for details). The main reason for this is so that if someone makes a change to this paragraph later on, it will be more obvious what has changed because diffs are done on a line-by-line basis.
I made a few inline comments about the new material, but in general it looks great! I like the challenge question; it's straightforward, and only tests one thing, which is perfect for this lesson. Would you mind also adding a solution to your challenge? We have been maintaining a list of solutions in |
Agreed that learners need to understand slicing, but I think we should try to find an example that's more authentic (i.e., something that might actually come up in real science). |
Ok, I'll try to come up with something more relevant... |
I find it difficult to judge the line between "something that might actually come up in real science" and obscure, so forgive me if these are still too generic/contrived. Appreciate the feedback! |
thanks - I'm happy if @tbekolay and @valentina-s are happy (though I'll reorganize at merge to put variable, slice, print together for each example to make it easier to follow) |
I will reorganize and merge. Also, I will convert the tuples to lists, we currently do not have introduction to tuples in the lesson. It will show an example of slicing a list of lists which I think will really test their understanding. |
Replace extract_figures.py with Javacript
…e to confirm the learner's understanding of slicing and negative indexing. Follow-up exercises could be written to further test understanding of step sizes and empty start/stop positions.