title: NameError: name 'word' is not defined even though i clearly defined it earlier in my code
body: <pre><code>if difficulty_choice == "easy":
      word = str(choice(easy))
      word_length="The word you\'ve been given contains %s letters"
      length=len(word)
      print word_length % length
  
  ###########
  
  list(word)
  </code></pre>
  
  <p>I defined word in a function, and then called up on the function. Everything works fine up till that point. However, afterward i tried to use the list function on word. Thats where i recieve the error, which tells me 'word' is not defined.</p>
  
  <p>Is there something wrong with defining a variable in a function?</p>