Hi mtf, thanks for your help.

But my confuse point is this:

it seems like in the first loop. X will keep the new value(reassiged value) after every iteration, and use the new value in the next iteration. For example, when x = 0 and i = 1, the x get the result 1. Then, the next iteration will be X = 1 and i =2, i can’t understand why x = 1 here, i think it should be still x = 0.

however, in the second loop, countString’s value is constantly, it’s ’ ’ in every lteration.

im not sure whether i claim my question clearly.