python + sqlite, insert data from variables into table

前端 未结 3 437
暖寄归人
暖寄归人 2020-12-15 07:36

I can insert hardcoded values into an SQLite table with no problem, but I\'m trying to do something like this:

name = input(\"Name: \")
phone = input(\"Phone         


        
3条回答
  •  余生分开走
    2020-12-15 08:13

    cur.executemany("insert into contacts (name, phone, email) values (?, ?, ?)", (name, phone, email))

提交回复
热议问题