I came across some Python programs that connect to a MySQL database. In the code, I saw the query in the execute()
function is enclosed withing 3 quotations("""
). I would like to know the reason for this. I also noticed that 3 quotes are used only while creating, inserting, and updating the table and not while selecting a row.
cursor.execute("""create table student(id char(10),name char(10))""")
cursor.execute("select * from student")
Why?