This is down to changes that were made for new versions of ZPE.
Lists are a simple name for an array in ZPE. Unlike standard arrays in languages such as Java or C, they can expand as necessary. Version 1.6.7 finally added fixed size lists (arrays).
$a = [44, 32, 99] print([4, 9, 3])
As of version 1.6.7 fixed size arrays are now possible:
$a =  * 4 print($a) $b = ["Hello world"] * 3 print($b)
The previous example will add the number
0 four times to the first list and
"Hello world" three times to the second
The difference between a list and an array (added in version 1.6.7) is that arrays have a fixed size whereas lists can be increased (or decreased) in size very easily. Arrays have the advantage of index existence, that is, one can be assured that such an index does exist.
Other languages use arrays and do not offer a list type and as a result, from an educational perspective, arrays are better suited as a teaching tool.
ZPE 1.8.6 (Younis) added support for negative indices. These will work backward from 0, e.g. -1 will be the last element within the list and -2 will be the penultimate element.
$l = [0, 1, 2, 3] print($l[-1])
For the sake of preventing accidental accessing a negative index that does not exist, for example applying -53 here, ZPE sanitises any negtaive index access automatically.
ZPE 1.8.6 also added ranges of indices. This allows you to obtain a list of items from the list very quickly.
$l = [0, 1, 2, 3] print($l[1:3])
Note that the range is inclusive and includes both the first index and the second index when
using this range, so the above example would return
[1, 2, 3].
S1s and S2s really enjoyed the lesson on cybercrime using the lesson on How to Rob A Bank on… https://t.co/MxjDYE2JFu
7 months ago
S2s doing really well in hardware test! Also really enjoying doing tests electronically rather than on paper.… https://t.co/ritdfcW6Mw
7 months ago
S1 and S2 pupils listing input and output devices and giving answers such as keyboard and mouse but there were also… https://t.co/dGxDkYqFxo
8 months ago