Cursus Raku / Elementa / Positionalia data genera / Interpolando array
Quiz — Interpolando array
Given the following array:
my @arr = 10, 9, 8, 3, 2, 1;
Complete the below programs to get the requested output.
1
Print the third element (the item with index 2
).
[2] | dic “Tertium elementum est @arr␣␣”; |
2
Print all elements (without indexing all of them explicitly).
arr[] | dic “Haec series continet: @␣␣␣␣.”; | Output est “Haec series continet: 10 9 8 3 2 1.” |
3
Print the size of the array (by calling the elems
method).
{@arr.elems} | dic “Sunt ␣␣␣␣␣␣␣␣ elementa.”; | Braces necessariae sunt ad Raku codicem in Raku string inserendum. |
Cursus navigatio
←
Positionalia data genera / @*ARGS
array
|
Positionalia data genera / Listae
→
💪 Or jump directly to the exercises to this section.
Haec pagina automatice translata est per ChatGPT 4o. Originalis Anglicus textus
Translationes huius paginae: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська