I am not too familiar with Jupyter, but I think it changes the scope behaviour by default (see GitHub - JuliaLang/IJulia.jl: Julia kernel for Jupyter). There it is also explained how to get the raw REPL scope experience
Regarding the code blocks have a look at Please read: make it easier to help you.