Practice 10_05_22

Run Settings
LanguageScala
Language Version
Run Command
object Main extends App { val name = "Mark" val age = 23 println(s"$name is $age years old") var x = 20 var res = "" if(x == 20){ res = "x = 20" }else { res = "x != 20" } println(res) val res2 = if (x == 20) "x = 20" else "x != 20" println(res2) println(if (x == 20) "x = 20" else "x != 20") while(x < 30) { println("Value of x is : " +x) x = x + 1 } val lst = List(1,7,3,8,44,2,5) for (i <- lst ; if i > 8) { println("The filtered value is : " +i) } }
object dio extends App { val lst = List(1,7,3,8,44,2,5) for (i <- lst ; if i > 8) { println("The filtered value is : " +i) } }
Editor Settings
Theme
Key bindings
Full width
Lines