Code Lab

Welcome by language

EasyMap and Set3 min

Greetings in different languages are already in the Map GREETINGS. The key is the language name, the value is the greeting.

Write a function greet(language) that returns the greeting in that language. If the language is not in the dictionary, return the English 'Welcome'.

Examples

greet('dutch')

Returns 'Welkom'

greet('IP_ADDRESS_INVALID')

Returns 'Welcome'

There is no such language in the dictionary.

Source

Loading the editor...
  1. Inputgreet('dutch')
    Expected'Welkom'
  2. Inputgreet('english')
    Expected'Welcome'
  3. Inputgreet('IP_ADDRESS_INVALID')
    Expected'Welcome'

Hidden tests run on Submit.