Course of Raku / Essentials / Associative data types / Exercises

Country codes

Problem

You have a list of two-letter country codes in the array:

my @codes = < FR IT DE EE LV US CN IN BR >;

Complete the program to print the full names of these countries, one at a line. Use the file cc.raku with the hash that maps country codes to the names.

Example

The program’s output is shown below. Only a few first names are shown:

$ raku country-codes.raku
France
Italy
Germany
. . .

Solution

See the solution

Next exercise

💪 Replace with antonyms

Course navigation

Positional data types / Subscripting ranges   |   Creating and calling functions