Skip to content

Commit 44884e5

Browse files
committed
chore: improve range examples
1 parent 30db857 commit 44884e5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/02_control_flow/03_Ranges.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ Ranges are also useful in `if` statements:
5656
fun main() {
5757
//sampleStart
5858
val x = 2
59-
if (x in 1..10) { // 1
60-
print(x)
59+
if (x in 1..5) { // 1
60+
print("x is in range from 1 to 5")
6161
}
62-
print(" ")
62+
println()
6363
64-
if (x !in 1..4) { // 2
65-
print(x)
64+
if (x !in 6..10) { // 2
65+
print("x is not in range from 6 to 10")
6666
}
6767
//sampleEnd
6868
}

0 commit comments

Comments
 (0)