From e7f231fc055ab6b2cc75de28d4547e8686d9e754 Mon Sep 17 00:00:00 2001 From: Xiaodong Date: Tue, 24 Apr 2018 14:42:02 +0800 Subject: [PATCH] Use println() rather than print() --- _tour/for-comprehensions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_tour/for-comprehensions.md b/_tour/for-comprehensions.md index eb0e033b15..1a2a73dfbb 100644 --- a/_tour/for-comprehensions.md +++ b/_tour/for-comprehensions.md @@ -42,7 +42,7 @@ def foo(n: Int, v: Int) = foo(10, 10) foreach { case (i, j) => - print(s"($i, $j) ") // prints (1, 9) (2, 8) (3, 7) (4, 6) (5, 5) + println(s"($i, $j) ") // prints (1, 9) (2, 8) (3, 7) (4, 6) (5, 5) } ``` @@ -60,7 +60,7 @@ You can omit `yield` in a comprehension. In that case, comprehension will return def foo(n: Int, v: Int) = for (i <- 0 until n; j <- i until n if i + j == v) - print(s"($i, $j)") + println(s"($i, $j)") foo(10, 10) ```