title: NameError while using append on a list [Python]
body: <p>I'm trying to make a simple hangman game in Python 2.7.10. However when I try to append "_" for every letter in the word in a list. It throws:</p>
  
  <pre><code>Traceback (most recent call last):
  File "C:\Users\Janek\Dropbox\python\vjesalo.py", line 82, in &lt;module&gt;
      append.wordlen(olo)
  NameError: name 'append' is not defined
  </code></pre>
  
  <p>No idea why this happends because if I run in the python terminal</p>
  
  <pre><code>list = []
  list.append("Bla bla bla")
  </code></pre>
  
  <p>It works just fine</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from sys import exit
  from time import sleep
  
          word = raw_input("Enter a word: ")
  
          if word.isalpha() == True:
              word.lower()
          else:
              print "Invalid word!"
              sleep(3)
              exit()
  
          wordlen = []    
          for i in range(len(word)):
              append.wordlen("_")
  
          print wordlen
  </code></pre>