title: How to use a dynamic variable in mysql query in python
body: <p>In my python code, I want to update the table value as per the user input so i need to pass the dynamic value in the query but i am not able to get any result.
  Can you suggest me way?</p>
  
  <p>Below is my code:`</p>
  
  <pre><code>import mysql.connector
  
  zone = # Dynamic value
  
  rate = # Dynamic value
  
  conn=mysql.connector.connect(user='root',password='1234',host='localhost',database='demo')
  
  
  mycursor=conn.cursor()
  
  mycursor.execute("UPDATE interest_rate SET interest=(rate,) where Bank_Name=%s",(zone,))
  
  conn.commit()
  `
  </code></pre>
  
  <p>How to pass the rate in the UPDATE query, I am able to pass the zone variable in the query.
  Can you help me to pass the rate variable?</p>
  
  <p>I am using python 3.4 and MySQL as the database.</p>