Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

how loop in scala

ratings.foreach {
    case(movie, rating) => println(s"key: $movie, value: $rating")
}

ratings.foreach(x => println(s"key: ${x._1}, value: ${x._2}"))
ratings.keys.foreach((movie) => println(movie))
ratings.keys.foreach(println)
ratings.values.foreach((rating) => println(rating))
Source by alvinalexander.com #
 
PREVIOUS NEXT
Tagged: #loop #scala
ADD COMMENT
Topic
Name
1+4 =