Ranges in for loop

Hello everyone

Im a beginner at kotlin, I am facing a problem while trying to print a 2D matrix in kotlin. Instead of printing out the 2D array it just prints the value one below the other.

whereas the tutorial that i am following, he is getting it correctly

(Sorry for the bad image. Screenshot was not allowed so i had to take a pic from my phone)

when I enter the range for the array in for loop, for some reason the IDE automatically adds ‘≤’ symbol.
For example my for loop looks like this : for ( i in 1 ≤ … ≤ 5) as seen in the first image.

kindly help :slight_smile:

Thank you ! :slight_smile:
Suganesh

You should know println is different from print.

And the is just a hint, never mind

2 Likes

Thank you ! indeed that was the problem ! silly mistakes bound to happen while learning… I have no past experience in coding. Also, thank you for the speedy reply !!

1 Like