title: Python count number of data in array list from response.json
body: <p>I am trying to count the amount of users inside an array of data (see below). As you can see I can successfully obtain the data from response.json. So basically I am able to print the DATA but I am finding it hard to come up with a code to count the amount of users inside that data, I know the amount of users are 5 but I want to when I add an extra user that count will increment automatically. </p>
  
  <p>Code:</p>
  
  <pre><code>    '''
      security service tests
      '''
      import sys
      sys.path.append('..')
      import requests
      import json
      from common.constants import *
      from config.settings import environment
  
  
      security_environment = environment()['security_service']
      service_url = "%s://%s:%d" % (
          security_environment['protocol'], 
          security_environment['host'], 
          security_environment['port'])
  
  
      def test1():
        print "TEST 1 - get user details"
  
  
        headers     = {'Accept': 'application/json'}
        url         = "%s/users" % service_url
        response    = requests.get(url, headers=headers)
        status_code = response.status_code
  
  
        print "STATUS: %s" % status_code
        print "DATA:   %s" % response.json()
  
        return status_code == HTTP_OK
  
       if __name__ == "__main__":
       num_pass = 0
       num_fail = 0
  
      for test in [test1]:
      print "-----------------------------------------------------------"
  
      if test():
        num_pass += 1
        print "PASS"
      else:
        num_fail += 1
        print "FAIL"
  
    print "==========================================================="
    print "%d passed, %d failed" % (num_pass, num_fail)
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>TEST 1 - get user details
  STATUS: 200
  DATA:   [{u'status': u'enabled', u'created_at': u'2016-02-09 10:49:28', u'id': 1, u'updated_at': u'2016-02-09 10:49:28', u'name': u'bart'}, {u'status': u'disabled', u'created_at': u'2016-02-09 10:49:28', u'id': 2, u'updated_at': u'2016-02-09 10:49:28', u'name': u'lisa'}, {u'status': u'enabled', u'created_at': u'2016-02-09 10:49:28', u'id': 3, u'updated_at': u'2016-02-09 10:49:28', u'name': u'homer'}, {u'status': u'disabled', u'created_at': u'2016-02-09 10:49:28', u'id': 4, u'updated_at': u'2016-02-09 10:49:28', u'name': u'marge'}, {u'status': u'enabled', u'created_at': u'2016-02-09 10:49:28', u'id': 5, u'updated_at': u'2016-02-09 10:49:28', u'name': u'maggie'}]
  PASS
  ===========================================================
  1 passed, 0 failed
  </code></pre>
  
  <p>Any Help?</p>