Elektrine lite

← Feed

@Blujean@mas.to

Post #2633338

2026-05-07 02:57 UTC

@davidruffner@raphus.social interesting, thank you. I wondered about the logic of the order as well.

Replies (1)

  • @hwine@vmst.io 2026-05-07 03:57

    @Blujean@mas.to @davidruffner@raphus.social Yeah, slices take a bit of getting used to. It helps me to thing of the first 2 values as "start" and "stop_before". So `a[1:1]` is not an element of the array, it's the space between elements 0 & 1. (slice starting at 1 and ending before 1) ``` a = [0, 1, 2, 3] print(a[1:1]) # [] print(a[:1], a[1:]) # [0] [1, 2, 3] ```

    Open ##2633339