title: TypeError: 'type' object is not subscriptable on list indexing
body: <p>Why does this code work throw error "<code>if list[(userlstlen-1)] &lt; list[(userlstlen-2)]: TypeError: 'type' object is not subscriptable</code>"</p>
  
  <p>I'm not indexing or calling any type/ object here.</p>
  
  <pre><code>def find_linear_quadratic(userlst, userlstlen):
      while userlstlen != 0:
          print("iteration: \n", userlstlen)
          # Start body here
          if list[(userlstlen-1)] &lt; list[(userlstlen-2)]:
              A = list[(userlstlen-1)]
              list[(userlstlen-1)] = list[(userlstlen-2)]
              list[(userlstlen-1)] = A
              userlstlen -= 1
      return userlst
  
  def main():
      list = [3,2,1]
      lstlen = list.__len__()
  
      find_linear_quadratic(list, lstlen)
  
  main()
  </code></pre>