Add illustration for visual intuition of indexing and slicing#1118
Add illustration for visual intuition of indexing and slicing#1118unode wants to merge 1 commit intoswcarpentry:mainfrom
Conversation
This illustration has been used to help beginners understand why the last digit of a slice doesn't imply including another element. The intuition makes a distinction between indexing, the number of the position, and slicing, the number of the gap between elements. For step based slices, the alternative intuition is to create rows with the values and keeping only the first row.
Thank you!Thank you for your pull request 😃 🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}. If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
Rendered Changes🔍 Inspect the changes: https://github.com/swcarpentry/python-novice-inflammation/compare/md-outputs..md-outputs-PR-1118 The following changes were observed in the rendered markdown documents: What does this mean?If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation. ⏱️ Updated at 2026-04-28 14:26:38 +0000 |
This illustration has been used to help beginners understand why the last digit of a slice doesn't imply including another element.
The intuition makes a distinction between indexing, the number of the position, and slicing, the number of the gap between elements.
For step based slices, the alternative intuition is to create rows with the values and keeping only the first row.
@tobyhodges