title: Convert MySQLdb return from tuple to string in Python
body: <p>I am new to MySQLdb. I need to read values from a pre-defined database which is stored in MySQL. My problem is when values are collected, they are in tuple format, not string format. So my question: Is there a way to convert tuple to string? </p>
  
  <p>Below are the details of my code</p>
  
  <pre><code>import MySQLdb
  
  #get value from database
  conn = MySQLdb.connect("localhost", "root", "123", "book")
  cursor = conn.cursor()
  cursor.execute("SELECT koc FROM entries")
  Koc_pre = str(cursor.fetchone()) 
  
  #create a input form by Django and assign pre-defined value
  class Inp(forms.Form):
      Koc = forms.FloatField(required=True,label=mark_safe('K&lt;sub&gt;OC&lt;/sub&gt; (mL/g OC)'),initial=Koc_pre) 
  
  #write out this input form
  class InputPage(webapp.RequestHandler):
      def get(self):
           html = str(Inp())
           self.response.out.write(html)
  </code></pre>
  
  <p>The output is in tuple format "Koc=('5',)", but I want "koc=5". So can anyone give me some suggestions or reference book I should check?</p>
  
  <p>Thanks in advance!</p>