A very simple question about for loop in julia

Since you’re running it in a script, and not immediately in the repl, it should behave in the >=1.5 way, assigning a local variable and giving a warning.

https://docs.julialang.org/en/v1/manual/variables-and-scoping/#On-Soft-Scope

As for solution, make it global a = a+1

1 Like