val nameMap = Map("firstName" -> "Ed", "lastName" -> "Chigliak") for ((k,v) <- nameMap) { println(s"key: $k, value: $v") } val result = for ((k,v) <- nameMap) yield { s"key: $k, value: $v" } println(result)