[Python] Can lists start at index 1?

Discussão em 'Python' iniciado por Stack, Maio 6, 2025.

  1. Stack

    Stack Membro Participativo

    I've downloaded from a supposedly serious source a sage script. It doesn't work on my computer, and a quick debugging showed that a problem came from the fact that at some point, the authors were doing as if a n-element list was numbered from 1 to n (whereas the "normal" numbering in Python and (thus) sage is 0..n-1).

    What am I missing? Is there a global variable hidden somewhere that changes this convention, like in APL?

    Continue reading...

Compartilhe esta Página