title: Python returns error NameError: name 'subject_t' is not defined
body: <p>Python returns error </p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 29, in &lt;module&gt;
  NameError: name 'subject_t' is not defined
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>name = raw_input('Enter your name')
  
  if name == 'Truxten':
      print "Hello Truxten"
      user_name = 'truxten'
  
  if name == 'Hannah':
      print "Hello Hannah"
      user_name = hannah
  
  if name == 'Matthew':
      print "Hello Matthew"
      user_name = matthew
  
  if name == 'Jax':
      print "Hello Jax"
      user_name = jax
  
  if name == 'Ellie':
      print "Hello Ellie"
      user_name = ellie
  
  def t_subject():
      subject_t = raw_input('Enter the Subject')
  
  if user_name == 'truxten':
      t_subject()
  
  print subject_t
  </code></pre>