title: Check if Sqlite3 query returns null Flask
body: <p>I'm having some trouble forming a conditional to check if the response to my API is <code>null</code> with Python. I am using Flask and SQLite3 modules. Below is a snippet of one of my resources.</p>
  
  <pre><code>class Sites(Resource):
          def get(self, store):
              print('Received a request at ADDRESS for Store ' + store )
              conn = sqlite3.connect('store-db.db')
              cur = conn.cursor()
              res = cur.execute('SELECT * FROM Sites WHERE StoreNumber like ' + store)
              for r in res:
                  if r == 'null':
                      return('No data', 404)
                  else:
                      column_names = ["StoreNumber", "Street", "StreetSecondary","City","State", "ZipCode", "ContactNumber", "XO_TN", "RelocationStatus", "StoreType", "Timezone"]
                      data = [r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10]]            
                      datadict = {column_names[itemindex]:item for itemindex, item in enumerate(data)}
                      return(datadict, 200)
  </code></pre>
  
  <p>If I make a request to a site that doesn't exist, the value returned is <code>null</code>, but none of my attempts of catching this are succeeding, so I'm wondering if my way of checking is incorrect with Python?</p>
  
  <p>I've tried <code>r[0] == 'null'</code>, <code>r is None</code>, <code>r == 'null'</code>, <code>r == null</code>, and <code>r == Null</code> to no avail.</p>
  
  <p><strong>Successful Request</strong></p>
  
  <pre><code>HTTP/1.0 200 OK
  Content-Type: application/json
  Content-Length: 333
  Access-Control-Allow-Origin: *
  Server: Werkzeug/0.14.1 Python/3.7.0
  Date: Thu, 15 Nov 2018 15:11:03 GMT
  
  {
    "StoreNumber": 42,
    "Street": "5000 Robinson Centre Drive",
    "StreetSecondary": "",
    "City": "Pittsburgh",
    "State": "PA",
    "ZipCode": "15205",
    "ContactNumber": "(412) 787-1330",
    "XO_TN": "(412) 249-9161",
    "RelocationStatus": "",
    "StoreType": "Dick's Sporting Goods",
    "Timezone": "Eastern"
  }
  </code></pre>
  
  <p><strong>Request with no data (should return 404)</strong></p>
  
  <pre><code>HTTP/1.0 200 OK
  Content-Type: application/json
  Content-Length: 5
  Access-Control-Allow-Origin: *
  Server: Werkzeug/0.14.1 Python/3.7.0
  Date: Thu, 15 Nov 2018 15:11:41 GMT
  
  null
  </code></pre>