3 ms·
> The main problem area is that "i" is changed within a loop the depends on i. This is very bad practice and will obviously lead to unexpected outcomes i's va
by not_your_vase 1y ago
> The main problem area is that "i" is changed within a loop the depends on i. This is very bad practice and will obviously lead to unexpected outcomes
i's value doesn't persist between loops, it's a brand new i in every iteration of a for range loop. One loops modifications have no effect on the next loop. If it was c or a similar language's classic for-loop, then modifying the loop variable would be risky. But it is not the case here.