I want to add all the values in a map without using var or any mutable structures. I have tried to do something like this but it doens't work:
val mymap = ("a" -> 1, "b" -> 2) val sum_of_alcohol_consumption = for ((k,v) <- mymap ) yield (sum_of_alcohol_consumption += v) I have been told that I can use .sum on a list Please help
Thanks