title: why this code run correctly? (python global keyword)
body: <p>I'm a newbie... and studying about <code>global</code> keyword.
  This code creates a random string.</p>
  <p>I think <em>line 8</em>, <code>string.append(word[x])</code> make error on this code
  because <code>string</code> is a global variable, so must be required <code>global</code> keyword. (global string)</p>
  <p>But this code runs correctly...
  Why can run correctly...?</p>
  <pre class="lang-py prettyprint-override"><code>import random
  word = 'a b c d e f g h i j k l m n o p q r s t u v w x y z'.split(&quot; &quot;)
  string = []
  n = int(input())
  
  def get(leng) :
      for i in range (0, leng) :
          x = random.randint(0, len(word)-1)
          string.append(word[x])
      sen = ''.join(string)
      return sen
  
  print(get(n))
  </code></pre>