Corso di Raku / Fondamenti / Altro sui tipi / Tipi di dati associativi / Hash annidati

Quiz — Hash multilivello

For the given data structure:

my %statistics =
    1900 => {
        Jan => 500,
        Feb => 550,
    },
    2000 => {
        Jan => 1230,
        Feb => 1245,
    };

Select the lines which provide correct access to the data item for February of 1900.

1say %statistics<1900><Feb>;
1say %statistics{1900}<Feb>;Questo è corretto, poiché 1900 può essere implicitamente convertito in una stringa.
0say %statistics{1900}{Feb};Errato, poiché Feb deve essere una stringa.
1say %statistics{'1900'}{'Feb'};

Hash annidati   |   Interpolazione di hash