I am trying to extract the values from the keys v1 and v2.
I would like it to print like this
first the v1
- 900
- 1800
and then v2
- 700
- 800
- 2600
- 1800
- 2100
This is how far I have done but I get an error in my second for loop that I do not know how to solve. Is this write scala approach to solve this or is there a better way?
val some_numbers = Map("v1"->(900, 1800),
"v2"->(700, 800, 2600, 1800, 2100))
for ((key,values) <-some_numbers) {
for(value<-values)
print(value)
}
Map[String, Product], quite useless. You probably misunderstand the usage of tuples here.