Code Lab

Mode entretien. Minuteur de 3 min, sans indices ni autocomplétion

Welcome by language

FacileMap 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'.

Exemples

greet('dutch')

Renvoie 'Welkom'

greet('IP_ADDRESS_INVALID')

Renvoie 'Welcome'

There is no such language in the dictionary.

Source

Chargement de l'éditeur...
  1. Entréegreet('dutch')
    Attendu'Welkom'
  2. Entréegreet('english')
    Attendu'Welcome'
  3. Entréegreet('IP_ADDRESS_INVALID')
    Attendu'Welcome'

Les tests cachés se lancent à la soumission