title: Julia While Loop not Working as Expected
body: <p>I'm having trouble understanding a problem I have with my Julia while loops. Here's a simple example:</p>
  
  <pre><code>i = 1
  while i &lt;10
      bb = 2
      i = i + 1
  end
  
  bb
  
  bb not defined
  while loading In[36], in expression starting on line 1
  </code></pre>
  
  <p>My question is how is bb not defined here? Is this a problem of scope? I don't think it is, because i is incremented to 10 at the end. </p>