title: TypeError: unsupported operand type(s) for +: 'decimal' and 'float'
body: <p>I am using Python 2.7 and MySQLdb. I get this error on this code:</p>
  
  <pre><code>Value = 5
  x.execute("SELECT number from Testing where id ='%s';" % Value)
  data = x.fetchall()
  print (data)
  data = data[0][0]
  data = data + 0.5
  x.execute(""" UPDATE Testing SET number = %s WHERE id = %s """, (data, Value))
  conn.commit()
  </code></pre>
  
  <p>The error occurs on the line: <code>data = data + 0.5</code>.</p>
  
  <p><code>TypeError: unsupported operand type(s) for +: 'decimal' and 'float'.</code> </p>
  
  <p>The number is a <code>DECIMAL(8,1)</code>. I have seen other questions with this error but not for adding. Plus, I think some people will have the same problem if they are new to Python and can't understand more advanced Python coding for similar problem questions. Could you please help me? Thanks in advance.</p>