-2

我是 python 新手,我的第一个程序出现语法错误。你能帮忙更正语法吗?

GET_CONTACT = "SELECT LINKEDIN_URL, CONTACT_ID from PERSON where LINKEDIN_URL=%s"

def isContactExists(linkedinUrl):
    cur.execute(GET_CONTACT, (linkedinUrl, ))
    return cur.fetchone()

if existing_contact is not None:
        storeInTempTable(record)
    return

引发语法错误 -

storeInTempTable(record)
                       ^
TabError: inconsistent use of tabs and spaces in indentation
4

1 回答 1

0

您的代码中都有空格和 TAB。不要混用空格和 TAB。

GET_CONTACT = "SELECT LINKEDIN_URL, CONTACT_ID from PERSON where LINKEDIN_URL=%s"

def isContactExists(linkedinUrl):
    cur.execute(GET_CONTACT, (linkedinUrl, ))
    return cur.fetchone()

if existing_contact is not None:
    storeInTempTable(record)
    return
于 2018-02-20T08:39:27.370 回答