title: How to know if object is of str or list or dict or int?
body: <p>I have a list of lists and then I'm extracting the last element from the list. Now, how to know whether it's of type <code>str</code> or <code>list</code> or <code>dict</code> or <code>int</code>?</p>
  
  <pre><code>list2 = response_list[0][-1]
  print list2,type(list2)  
  print "not executing"
  print list2
  </code></pre>
  
  <p>I have failed to match if that element is <code>list</code> or <code>str</code> by the following code:</p>
  
  <pre><code>    list2 = response_list[0][-1]
      if type(list2) == str() :
          print list2,type(list2)
      elif type(list2) == list() :
          print list2,type(list2)
  </code></pre>