# For Loop why does not working correctly

**URL:** <https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [January 20, 2022, 1:54pm UTC](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938 "2022-01-20T13:54:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vlkan](https://avatars.discourse-cdn.com/v4/letter/v/e47c2d/32.png) [@vlkan](https://discourse.julialang.org/u/vlkan)\
**Post date:** [January 20, 2022, 1:54pm UTC](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938/1 "2022-01-20T13:54:35Z")

</div>

Hello everyone, I encountered a strange error while making an example for a for loop. It works correctly on the video, document and online compiler on the Internet, but on my computer it generates random numbers. What is the reason of this? Thanks.  
 ![why](https://global.discourse-cdn.com/julialang/original/3X/1/b/1b143936fabe927a48f5f9d8036274d48e5df262.png)

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [January 20, 2022, 1:55pm UTC](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938/2 "2022-01-20T13:55:57Z")

</div>

are you sure you re-run the cell? maybe restart the Julia kernel from jupyter menu and try again

---

<div class="post-metadata">

**Author:** ![vlkan](https://avatars.discourse-cdn.com/v4/letter/v/e47c2d/32.png) [@vlkan](https://discourse.julialang.org/u/vlkan)\
**Post date:** [January 20, 2022, 1:57pm UTC](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938/3 "2022-01-20T13:57:42Z")

</div>

Yeah, When restart the kernel, its fixed. Thanks.

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [January 20, 2022, 3:09pm UTC](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938/4 "2022-01-20T15:09:21Z")

</div>

I am really curious what happened in that scope 😆

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [January 20, 2022, 6:04pm UTC](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938/5 "2022-01-20T18:04:27Z")

</div>

I’m not willing to wrap my head around it but it might be [SoftGlobalScope.jl](https://github.com/stevengj/SoftGlobalScope.jl) thing 😃
