Indentation error in python and index out of range error
<p>I am getting an indentation error. Can anyone help me to fix it and also getting <code>tuple index out of range error</code> too</p>

<p>here is my code</p>

<pre><code>def POST(self):
        form = web.input(name="a", newname="s", number="d")
        conn = MySQLdb.connect(host= "localhost", user="root", passwd="", db="testdb")
        x = conn.cursor()
        x.execute("SELECT * FROM details  WHERE name = '%s'" % (form.name))
        conn.commit()
        items = x.fetchall()
        for row in items:
            print row[0], row[1],row[2]
            print("&lt;table border='1'&gt;")
            print("&lt;tr&gt;")
            print("&lt;th&gt;name&lt;/th&gt;")
            print("&lt;th&gt;address&lt;/th&gt;")
            print("&lt;th&gt;number&lt;/th&gt;")
            print("&lt;/tr&gt;")
            print("&lt;tr&gt;")
            print("&lt;td&gt;{0}&lt;/td&gt;".format(row[0]))
            print("&lt;td&gt;{1}&lt;/td&gt;".format(row[1]))
            print("&lt;td&gt;{2}&lt;/td&gt;".format(row[2]))
            print("&lt;/tr&gt;")
            print("&lt;/table&gt;")

            conn.rollback()
            conn.close()
            #return render.index(items)

if __name__ == "__main__":
    app.run()
</code></pre>

<p>am getting error in these lines</p>

<pre><code> print("&lt;/tr&gt;")
 print("&lt;/table&gt;")
</code></pre>

<p>This is a very basic error.If you are using sublime text.Please select all the rows.
In the beginning of each line of def POST, there will be two patterns.
One is '_____' and '.......' .The pattern should be similar for whole 
 'def POST(self):'
Please make sure this and error will get removed.</p>

<p>Copy and paste this code:</p>

<pre><code>    def POST(self):
            form = web.input(name="a", newname="s", number="d")
            conn = MySQLdb.connect(host= "localhost", user="root", passwd="", db="testdb")
            x = conn.cursor()
            x.execute("SELECT * FROM details  WHERE name = '%s'" % (form.name))
            conn.commit()
            items = x.fetchall()
            for row in items:
                print row[0], row[1],row[2]
                print("&lt;table border='1'&gt;")
                print("&lt;tr&gt;")
                print("&lt;th&gt;name&lt;/th&gt;")
                print("&lt;th&gt;address&lt;/th&gt;")
                print("&lt;th&gt;number&lt;/th&gt;")
                print("&lt;tr&gt;")
                print("&lt;td&gt;{0}&lt;/td&gt;".format(row[0]))
                print("&lt;td&gt;{1}&lt;/td&gt;".format(row[1]))
                print("&lt;td&gt;{2}&lt;/td&gt;".format(row[2]))
                print("&lt;/tr&gt;")
                print("&lt;/table&gt;")

                conn.rollback()
                conn.close()
                #return render.index(items)

    if __name__ == "__main__":
        app.run()
</code></pre>

<p>Thanks.</p>

python python-2.7