title: sqlite cursor fetchone() returns 'NoneType'?
body: <p>I want to build a function that returns the lowest row count from all tables if the two scores <code>scor1</code> and <code>scor2</code> are not both 0  :</p>
  
  <pre><code>def mini(tablelist):
  mini = 1000
  for table in tablelist:
      c.execute("SELECT numar_par FROM " + table + "")
      c_min = len(c.fetchall())
  
      if c_min is None:
          mini = 0
      else:
          c.execute("SELECT scor1 FROM " + table + " ORDER BY numar_par DESC LIMIT 1")
          print("this is fetchone:",c.fetchone(),'from table: ',table)
          scor1 = c.fetchone()[0]
          c.execute("SELECT scor2 FROM " + table + " ORDER BY numar_par DESC LIMIT 1")
          scor2 = c.fetchone()[0]
          sum = int(scor1) + int(scor2)
          if c_min &lt; mini and sum &gt;0:
              mini = c_min
  return mini
  </code></pre>
  
  <p>This is the result of the print statement:</p>
  
  <pre><code>this is fetchone: ('0',) from table:  a
  </code></pre>
  
  <p>and this is the error:</p>
  
  <pre><code>File "D:\pariuri\python\Pycharm test1\Test11 peste 0.5\functii.py", line 181, in mini
  scor1 = c.fetchone()[0]
  TypeError: 'NoneType' object is not subscriptable
  </code></pre>