The way loops work, is that they keep repeating until a condition is met. In the example what it is saying is:

While x is not 9 then do this.

So the first time it loops it goes in order.

x = x+1 means make the value of x equal to the value of x + 1. The reason is so we can eventually break the while loop. Because if you think about it, x will always never = 9 if you don’t make it 9. So without it it would loop infinitely. Each time it loops x will have a new value until it reaches 9 which is when the loop is told to stop.

First loop would be:

x(which is 0) = x(which is still 0) + 1

Which if you can do math is 1

So it now becomes x = 1

Then the next time it would be

x(which is 1 because it changed the first time it looped) = x(which is still 1) + 1

Which makes x = 2. You get the idea, eventually it x = 9 and then the condition for the loop will be false (since if 9 is not 9, which it is)

For the io.write, its basically saying output x each time but with a concatenated string, which basically conjoins the two together. So it would be: x<space> since " " is a space.

So in the end you’ll end up with

1 2 3 4 5 6 7 8 9

and it will end at 9 because the statement is false, because 9 does = 9.

I probably waffled a bit but I tried to explain it asthough I was talking to you in person. Hope this helps.