更新时间:2023-01-21 12:58:22
您可以创建布尔对象并在执行后比较您的答案:
you can make boolean object and after executing compare your answer :
cur = connection.cursor()
query = """ SELECT * FROM `foo` """
cur.execute(query)
result = cur.fetchall()
inputvalue = input("Input= ")
temp = False
for x in result:
if inputvalue in x:
temp = True
if temp:
print(inputvalue)
else:
print("Data Does Not Exist")