in reply to Re^6: Converting python list range expressions to perl
in thread Converting python list range expressions to perl
AFAIR from a previous discussion is Perl using closed intervals while Python using half open ones.
That means the end point is excluded in Python.
One advantage is that [:X] and [X:] are splitting an interval including X exactly into two dijoint parts, without needing to decrement the first end boundary.
I.O.W always $end-- when translating to Perl.
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Converting python list range expressions to perl
by ibm1620 (Hermit) on Dec 05, 2022 at 22:58 UTC |