我使用以下代码在系统中进行预订,但它返回错误:
conn = sqlite3.connect('SADS.db')
cur = conn.cursor()
choice = raw_input("What day would you like to book seats on? F/S : ")
if choice == "F":
bookseats = [0,1]
print"What seats would you like to book?"
bookseats[0] = raw_input("Choice : ")
bookseats[1] = raw_input("What is their user ID? : ")
cur.execute("SELECT * FROM seats WHERE Booked='N'")
rows = cur.fetchone()
for row in rows:
if row == None:
break
elif row[1] == bookseats[0] and row[4] == "N" and row[3] == "F":
print "Seat Number:" , row[1] ,"Is now booked!"
cur.execute("UPDATE seats SET Booked =N AND CustID=?", (bookseats[0]))
错误:
TypeError: 'float' object has no attribute '__getitem__'
我真的很困惑错误是什么以及如何解决它?