← 2023 questions

2023 / GRAB / QUESTION 24

Cuisine finder

Try the question in your own editor, then check your output below.

THE QUESTION

Tristan wants to order food to his house through Grab. The file below contains restaurants and their cuisines. Use this information to create a nested dictionary, which can then be filtered and displayed, so that Tristan can choose what cuisine he wants and see the restaurants that meet his criteria.

Question by Taysia. Source: Girls In Code SEA — Behind the Screens, 2023, slide 41.

CHECK YOUR ANSWER

Try your answer.

Run your program in your own editor, then paste its output below. This checks the stated output; it does not assess your full program. Practice attempts do not affect competition scores.

Use input Chinese. Enter the matching restaurants from the supplied file.

Reveal worked answer

Chinese cuisine · one valid answer

["Esquire Kitchen", "Din Tai Fung"]

Read alternating restaurant/cuisine lines, group by cuisine, then select Chinese.