Course of Raku / Essentials / Associative data types / Pairs

Quiz — Pairs

1

Complete the program to print the following output:

India
New Delhi

Here is the program:

. my $city = India => 'New Dehli';
key say $city.␣␣␣␣;
value say $city.␣␣␣␣;

2

What does this program print?

my $data = 1 => 2;
say $data.WHAT;
(Pair) Output: (: (Int), (Array), (Pair) :) This is a pair Pair $data = 1 => 2, where both the key and the value are integers.

Course navigation

Associative data types   |   Associative data types / Hashes


💪 Or jump directly to the exercises to this section.