0
到目前为止,这是我的代码和我不断收到一个错误,指出: “sqlite3.OperationalError:近‘)’:语法错误”如何在python 3 for mac中使用SQLite3创建数据库?
import sqlite3
con = sqlite3.connect("DatabaseName.sql")
cur = con.cursor()
cur.execute("""CREATE TABLE Contacts (Fname TEXT,
Lname TEXT, Phone INTEGER,)""")
Fname = input("Enter first name: ")
Lname = input("Enter last name: ")
Phone = input("Enter telephone number(no dashes or spaces): ")
Phone = int(Phone)
cur.execute("""INSERT INTO Contacts (Fname, Lname, Phone, joined_club)
VALUES (?,?,?)""", (Fname,Lname,Phone))
con.commit()
cur.close()
con.close()
非常感谢。新鲜的眼睛总是能做到这一点。 – MrDRiceJr