You have to use global a
inside of for
.
julia> a = 5
5
julia> for i in 1:5
global a = a + i
end
julia> a
20
You have to use global a
inside of for
.
julia> a = 5
5
julia> for i in 1:5
global a = a + i
end
julia> a
20