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