+ 2
It says less than or equal to 4
It starts counting at 0
0
1
2
3
4
And because you do the + 1
It goes
0+1 = 1
1+1 = 2
Etc
Etc
4+1 = 5
<= is the same as âless than or equal toâ
+ 5
It's due to A<=4.
When A is 4, the loop goes on to A = 5 and outputs. Then A<= is evaluated again, now false, and stops
+ 2
Btw, try switching the A+=1 and the print statement around. The order matters here and it is good to realise the difference
+ 1
clear
0 1 2 3 4
count them
they're five
you saying add one till you are equal or smaller than 4
so the app is doing
but it starts at zero index
that's the reason.