title: Local variable 'list' referenced before assignment
body: <p>I made a simple script that converts any input text into a "code" and can also translate it back. It only works one word at a time. </p>
  
  <p>I want to make the script adds each new code to a list that is printed every time. For example, the first time you translate something, <code>"HELLO"</code> becomes <code>"lohleci"</code>. The second time, I want it not only to show <code>"world"</code> = <code>"ldwropx"</code>, but also state below everything translated so far.</p>
  
  <p>I'm new to Python and have looked through forums for people with similar problems. The way I tried doing it (a segment was removed and put into a separate script), I get an error saying "local variable 'list' referenced before assignment." This is the code producing the error:</p>
  
  <pre><code>list = "none"
  def list():
      word = raw_input("")
      if list == "none":
          list = word + " "
          print list
          list()
      else:
          new_list = list + word + " "
          list = new_list
          print list
          list()
  list()
  </code></pre>