Scala – For Loop

So what is a loop ?
loops allow us to execute a statement or a block of statements multiple times. Like conditional statements, they are controlled by boolean expressions.

The for comprehension
Scala’s for is much more powerful than Java’s for Consequently, it is used much more often than the other kinds of loops.

Syntax − for loop

Example − for loop