title: How to reference a string in a list in python
body: <p>I've been writing a program (a hangman game) today, and have come across a few snags, I know you guys don't like people just using this as answers to their homework, but I have searched quite a while, and while I have posted this program earlier in the development, I have come to new ground. I am getting to grips with lists, tuples, dictionaries, etc. and this program has been great practice. Sorry for the wall of text!</p>
  
  <p><em>The Question:</em></p>
  
  <p>Is there a way to refer to a string when using a list?</p>
  
  <p>Context - defining a function (last line being a test to see if working)</p>
  
  <pre><code>def click_1 (text):
      key_1 = word.index [letter]
      hidden_word[key_1] = letter
      print (hidden_word)
  </code></pre>
  
  <p>This throws up a long error, which I wont post, here is the 'important' part in my eyes:</p>
  
  <pre><code>File "/Users/foo/Desktop/Hangman.py", line 19, in click_1
      key_1 = word.index [letter]
  TypeError: 'builtin_function_or_method' object is not subscriptable
  </code></pre>
  
  <p>If someone could help me, that would be great. I've tried using the 'in' statement, but I have not been able to make it work - currently, though I suspect it may be part of the solution. I've tried:</p>
  
  <pre><code>key_1 = word.index [letter in word]
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>key_1 = word.index([letter] in word)
  </code></pre>
  
  <p>both of which do not work.</p>
  
  <p>Cheers in advance from a young programmer!</p>