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

Slicing lists diagram are off by 1 for negative values #81

Open
Spaxe opened this issue Dec 3, 2019 · 0 comments
Open

Slicing lists diagram are off by 1 for negative values #81

Spaxe opened this issue Dec 3, 2019 · 0 comments

Comments

@Spaxe
Copy link

Spaxe commented Dec 3, 2019

The diagram for visualising slicing (https://csiro-data-school.github.io/python/04-lists/index.html) says

+---+---+---+---+---+---+---+---+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+---+---+---+---+---+---+---+---+
0   1   2   3   4   5   6   7   8
-8  -7  -6  -5  -4  -3  -2  -1

Where as it should be (note the offset)

+---+---+---+---+---+---+---+---+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+---+---+---+---+---+---+---+---+
0   1   2   3   4   5   6   7   8
    -8  -7  -6  -5  -4  -3  -2  -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant