We have the Map of capitals by country names in the scope:
val capitals: Map[String, String] = Map(
"France" -> "Paris",
"Japan" -> "Tokyo",
...
)
We would like to get a capital by the name of the country. Rewrite the code to avoid possible runtime errors. If the value doesn't exist in the Map, print The capital doesn't exist or is not listed.