New course! Every coder should learn Generative AI!
Try a free lesson+ 6
i += 1 is the same as i = i+1
So at the end of each iteration I is increased by 1. Then python checks if i is still < 6. If so, the loop continues. If not, i < 6 is no longer True. It is False and the loop stops.
Please remember to tag the relevant programming language!