는 다음 코드와 아무 잘못 볼 수 없습니다 :왜 ELIF 구문이 잘못 되었습니까?
elif choice == "2":
while True:
PhoneSearch = raw_input("What is their telephone number? : ")
conn = sqlite3.connect('SADS.db')
cur = conn.cursor()
cur.execute("SELECT * FROM customers WHERE Telephone = (?)",(PhoneSearch,))
row = cur.fetchone()
if row:
CustID = row[0]
print "|------------------------------------------|"
print "|Customer ID : " , row[0]
print "|Forename : " , row[1]
print "|Surname : " , row[2]
print "|Address Line 1 : " , row[3]
print "|Address Line 2 : " , row[4]
print "|City : " , row[5]
print "|Postcode : " , row[6]
print "|Telephone number : " , row[7]
print "|E-Mail : " , row[8]
while True:
print '|Do you want to see what seats', row[1]
choice = raw_input("|Choice Y/N:")
if choice == 'Y':
cur.execute("SELECT * FROM seats WHERE CustID = (?)", (CustID,))
rowseat = cur.fetchone()
if rowseat: # or if rowseat is not None, etc.
print "|Seats booked:" , rowseat[0]
print "|------------------------------------------|"
break
else:
print("database doesn't have correct info")
else:
print("Na")
을하지만 내가 맨 위에하기 Elif 문에 구문 오류가 발생합니다. 왜 이런 일이 발생했는지 또는 오류가 발생한 곳을 말해주십시오.
코드가 실제로 들여 쓰여졌습니까? ('elif'는'while ')? 그렇다면 그것은 문제입니다. 또한, 전에'if'가 있고'elif'로 시작하는 것이 아닙니다, 맞습니까? – Dougal