Skip to content

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

@Spaxe

Description

@Spaxe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions